Subject: Re: [xsl] Saxon errors From: Rob Newman <rlnewman@xxxxxxxx> Date: Thu, 10 May 2007 08:50:12 -0700 |
Regards, - Rob
Kamal Bhatt wrote:In your input, change "<" to < and ">" to > .
You cannot use < and > in XML data (unless it is enclosed in CDATA "tags"). Actually, you probably could use < in some circumstances, but it is best to play it safe.
No, the < can never be used unless inside CDATA. But you can use the > safely without escaping. There are only two entities that must always be escaped: < and &. The other default entities, >, " and ' sometimes do and sometimes don't need to be used:
<!-- valid xml --> <input value=" ' " /> <input>>>></input> <input value=">>>" /> <input value=' " ' />
(to take this to an extreme, note that the string ]]> cannot be used inside CDATA... or... outside CDATA. but all the rest: np)
but the OP had < in an attribute and like you said: that is illegal. In addition, there also appeared a " in the attribute and without changing the surrounding quotes, it should be escaped. The attribute equals the XML declaration string. I think the OP does not want valid XML like this (note the quote change):
<pfarr name='<?xml version="1.0" encoding="iso-8859-1"?>'>
but like this:
<?xml version="1.0" encoding="iso-8859-1"?> <pfarr name="xyz"> <pfarr name="dls">
which, interestingly, is precisely the way the XML looked in a post by the same person, at 6 feb 2007 about multiple sorts on element attributes. My guess is, that somehow the source got tangled during these months... ;)
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Saxon errors, Abel Braaksma | Thread | RE: [xsl] Saxon errors, Michael Kay |
Re: [xsl] Comparing an XML value fr, Abel Braaksma | Date | [xsl] indent="yes" and <pre>, Martynas Jusevicius |
Month |