Write to XML: B34A1190 : colon gets replaced with an underscore in the element/tag na

chawla.sheetal

Member
Hi All, I am trying to use B34A1190 by copying and changing the encoding to UTF-8 as suggested in the above solution. Everything works fine - its adding the tags(elements), attributes perfectly and generating the XML except that its replacing the colon in the tag name by an underscore and its all through the API For e.g.


<cbc:UBEVersionID>1.0</cbc:UBEVersionID> is being written as
<cbc_VersionID>1.0</cbc:UBEversionID>



Now since colon is a special character to an XML, with UTF- encoding it should be written in a different way as I read about it. So while writing the element name as a parameter i tried using


ElementName as 'cbc&58#;UBEVersionID' but still doesnt work. Doed anyone has a clue, how can we insert that colon in teh tag name and not getting it replaced it with an underscore. Any help is appreciated.
 
Colons define xml namespaces. Unless you had a way to add the necessary stuff to the xml header to define the namespace, you not get a valid xml file when colons are in the tag names. Since colons occur in arbitrary RDA constants (which are turned into tags) JDE did this to make UBE output still loadable to XML parsers, as none of those fields are actually defining valid xml namespaces in their shipped product.

Try manually replacing the underscores with colons and then loading your xml file into a parser to see what I mean.

Example of valid xml that uses colons in tags:
Code:
<root xmlns:furn="http://www.w3schools.com/furniture">

<furn:table>
  <furn:name>African Coffee Table</furn:name>
  <furn:width>80</furn:width>
  <furn:length>120</furn:length>
</furn:table>

</root>

Another option might be to send it thru BIP with the identity XSLT to move from your source codepage into UTF-8.
 
Back
Top