0

I don't know why, Firefox adds xmlns="" to my xml elements Here's my base xml document. I would like, in javascript, to add a Relationship

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
    <Relationship Id="rId8" Target="endnotes.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"/>
    <Relationship Id="rId13" Target="footer1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"/>
    <Relationship Id="rId3" Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"/>
    <Relationship Id="rId7" Target="footnotes.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"/>
    <Relationship Id="rId12" Target="header1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"/>
    <Relationship Id="rId2" Target="numbering.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"/>
    <Relationship Id="rId1" Target="../customXml/item1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"/>
    <Relationship Id="rId6" Target="webSettings.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings"/>
    <Relationship Id="rId11" Target="media/image3.png" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"/>
    <Relationship Id="rId5" Target="settings.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"/>
    <Relationship Id="rId15" Target="theme/theme1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"/>
    <Relationship Id="rId10" Target="media/image2.png" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"/>
    <Relationship Id="rId4" Target="stylesWithEffects.xml" Type="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects"/>
    <Relationship Id="rId9" Target="media/image1.png" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"/>
    <Relationship Id="rId14" Target="fontTable.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"/>
</Relationships>

The code works fine in Chrome, but adds xmlns="" as an attribute of Relationship in Firefox:

http://jsfiddle.net/USLFs/2/

I have found here Stackoverflow question that it is probably linked to the fact that I should set the same Namespace for the child element as for the root element.

Thanks in advance

4

1 回答 1

0

除了使用正则表达式或字符串替换外,我没有办法从 Firefox 中删除这种行为。

于 2013-07-20T12:02:37.443 回答