This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ampersand in data


John Gethoefer wrote:
> I am trying to transform XML data such as follows:
> 
> <Name>Jack & Jill</Name>

That's not XML, because it's not well-formed.

Any of these are XML:

<Name>Jack &amp; Jill</Name>
<Name>Jack &#38; Jill</Name>
<Name>Jack &#x22; Jill</Name>
<Name><![CDATA[Jack & Jill]]></Name>

If you don't make your XML well-formed, it will never get past
the parser, which is what tells the XSLT parser what logical
structures (elements, attributes, etc) are in the document.

The parser requires well-formed XML, because otherwise how is
it supposed to know when your markup characters ("&" "<" ">"
and sometimes "'" """) are really just ordinary character data?

-Mike


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]