From 96bf42261b6e836f86c3e042a256e933a017cfe7 Mon Sep 17 00:00:00 2001
From: Victor Berchet
Date: Fri, 12 Aug 2016 21:26:03 -0700
Subject: [PATCH] fix(XmlHelper): declaration
---
.../@angular/compiler-cli/integrationtest/test/i18n_spec.ts | 2 +-
modules/@angular/compiler/src/i18n/serializers/xml_helper.ts | 2 +-
modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts | 2 +-
.../compiler/test/i18n/serializers/xml_helper_spec.ts | 2 +-
modules/@angular/compiler/test/i18n/serializers/xtb_spec.ts | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/@angular/compiler-cli/integrationtest/test/i18n_spec.ts b/modules/@angular/compiler-cli/integrationtest/test/i18n_spec.ts
index 55a95f11f2..f382332f46 100644
--- a/modules/@angular/compiler-cli/integrationtest/test/i18n_spec.ts
+++ b/modules/@angular/compiler-cli/integrationtest/test/i18n_spec.ts
@@ -15,7 +15,7 @@ describe('template i18n extraction output', () => {
const outDir = '';
it('should extract i18n messages', () => {
- const EXPECTED = ` xml version="1.0" encoding="UTF-8" ?>
+ const EXPECTED = `
diff --git a/modules/@angular/compiler/src/i18n/serializers/xml_helper.ts b/modules/@angular/compiler/src/i18n/serializers/xml_helper.ts
index 5e0354520b..d5d142581d 100644
--- a/modules/@angular/compiler/src/i18n/serializers/xml_helper.ts
+++ b/modules/@angular/compiler/src/i18n/serializers/xml_helper.ts
@@ -28,7 +28,7 @@ class _Visitor implements IVisitor {
visitText(text: Text): string { return text.value; }
visitDeclaration(decl: Declaration): string {
- return ` xml${this._serializeAttributes(decl.attrs)} ?>`;
+ return ``;
}
private _serializeAttributes(attrs: {[k: string]: string}) {
diff --git a/modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts b/modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts
index 36d1302d32..817351737c 100644
--- a/modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts
+++ b/modules/@angular/compiler/test/i18n/serializers/xmb_spec.ts
@@ -22,7 +22,7 @@ export function main(): void {
foo
{ count, plural, =0 { { sex, gender, other {
deeply nested
}} }}
`;
- const XMB = ` xml version="1.0" encoding="UTF-8" ?>
+ const XMB = `
diff --git a/modules/@angular/compiler/test/i18n/serializers/xml_helper_spec.ts b/modules/@angular/compiler/test/i18n/serializers/xml_helper_spec.ts
index 49b4e14917..98972f05cf 100644
--- a/modules/@angular/compiler/test/i18n/serializers/xml_helper_spec.ts
+++ b/modules/@angular/compiler/test/i18n/serializers/xml_helper_spec.ts
@@ -14,7 +14,7 @@ export function main(): void {
describe('XML helper', () => {
it('should serialize XML declaration', () => {
expect(xml.serialize([new xml.Declaration({version: '1.0'})]))
- .toEqual(' xml version="1.0" ?>');
+ .toEqual('');
});
it('should serialize text node',
diff --git a/modules/@angular/compiler/test/i18n/serializers/xtb_spec.ts b/modules/@angular/compiler/test/i18n/serializers/xtb_spec.ts
index f8f8e97a84..6511a3c2b3 100644
--- a/modules/@angular/compiler/test/i18n/serializers/xtb_spec.ts
+++ b/modules/@angular/compiler/test/i18n/serializers/xtb_spec.ts
@@ -84,7 +84,7 @@ export function main(): void {
it('should replace ICU placeholders with their translations', () => {
const HTML = `-{ count, plural, =0 {
bar
}}-
`;
- const XTB = ` xml version="1.0" encoding="UTF-8" ?>
+ const XTB = `
**
{ count, plural, =1 {rab}}
@@ -103,7 +103,7 @@ export function main(): void {
foo
{ count, plural, =0 {{ sex, gender, other {
bar
}} }}
`;
- const XTB = ` xml version="1.0" encoding="UTF-8" ?>
+ const XTB = `
rab oof
{ count, plural, =1 {rab}}