Hi;

 

Calling Element.addElement(“name”) gives different results from Element.addElement(“name”, “default_uri”) where in the parent (not root) node I have xmlns="default_uri"

 

Shouldn’t they be identical?

 

Example 1:

Element elem = xmlElement.addElement("CustomDocumentProperties", "urn:schemas-microsoft-com:office:spreadsheet");

elem.addNamespace("", "urn:schemas-microsoft-com:office:office);

Element sub = elem.addElement("WindwardReports", "urn:schemas-microsoft-com:office:office");

 

Produces:

  <CustomDocumentProperties xmlns="urn:schemas-microsoft-com:office:office">

    <WindwardReports dt:dt="string">Version: 4.0.12</WindwardReports>

  </CustomDocumentProperties>

 

Example 2:

Element elem = xmlElement.addElement("CustomDocumentProperties", "urn:schemas-microsoft-com:office:spreadsheet");

elem.addNamespace("", "urn:schemas-microsoft-com:office:office);

Element sub = elem.addElement("WindwardReports”);

 

Produces:

  <CustomDocumentProperties xmlns="urn:schemas-microsoft-com:office:office">

    <WindwardReports xmlns="urn:schemas-microsoft-com:office:spreadsheet" dt:dt="string">Version: 4.0.12</WindwardReports>

  </CustomDocumentProperties>

 

Why is it adding the xmlns="urn:schemas-microsoft-com:office:spreadsheet" in example 2 to <WindwardReports

 

??? – thanks – dave

 

 

David Thielen

www.windwardreports.com

303-499-2544

 

 

Reply via email to