XMLdom: Loading a XML with an '&' in a node

jensthomsenjensthomsen Member Posts: 173
I have a XML with a '&' in a node (could be a name like 'Smith & Smith'). I'm not able to load this XML via the 'LOAD' command??

Are there som kind of work around to this?

Comments

  • Yaroslav_GaponovYaroslav_Gaponov Member Posts: 158
    Hi

    The nice practice - all tag name bring to some standard. Just look for here
    http://www.xml.com/lpt/a/2001/07/25/namingparts.html

    So, if some symbol is bad - just convert it to hex format like x1234 ;)
  • jensthomsenjensthomsen Member Posts: 173
    [quote=So, if some symbol is bad - just convert it to hex format like x1234 ;)[/quote]

    Which other symbols are "bad" ??
  • jensthomsenjensthomsen Member Posts: 173
    [quote=So, if some symbol is bad - just convert it to hex format like x1234 ;)[/quote]

    Which other symbols are "bad" ??
  • jensthomsenjensthomsen Member Posts: 173
    Are there any code that XMLDom would interpret as the 'Bad' characters? Or put differently: Could the sender of the XML type something different like &amp that XMLDom would properly interpret as '&'?
  • jensthomsenjensthomsen Member Posts: 173
    And I found the solution: If the sender types "&" the XMLDom in Navision translates this to correct AND-char:-)
  • jlandeenjlandeen Member Posts: 524
    As XML documents contain meta data & data, and there are set rules about the structure of the meta date - this requires that there be some "reserved" characters that cannot freely be used in the data.

    Check out the end of this article: http://www.xmlnews.org/docs/xml-basics.html

    Also check out the escape characters section in: http://hdf.ncsa.uiuc.edu/HDF5/XML/xml_escape_chars.htm

    Basically there are 5 characters (<>&"') that should not be placed in XML data (as they have special meaning in the meta data tags). So if you need you need to translate those characters to values that can be put in XML data. These 5 special characters have other characters sequences that you can use - just do a simple text find & replace operation when exporting the XML data, or you can use the Hexadecimal ASCII code of the character.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
Sign In or Register to comment.