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]
Other format: [Raw text]

Re: Document() and &


[Josh Beach]>

> I made a small sample piece of XSL that I have proven not to work. The
> system that provides the XML source is not accessible to the outside
> world so I don't have a proper URL that I can give you. Any URL should
> will work fine though except when the url has and ampersand in it...
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>
> <xsl:output method="xml"/>
>
> <xsl:template match="/">
> <xsl:copy-of
>
select="document('http://www.somewhere.com/getDocument.html?docType=xml&amp;
> id=12345')"/>
> </xsl:template>
>
> </xsl:stylesheet>
>
> Here is a snippet that uses a variable that unfortunately works the same.
>
> <xsl:variable
>
name="DocumentURL">http://www.somewhere.com/getDocument.html?docType=xml&amp
;
> id=12345</xsl:variable>
> <xsl:copy-of select="document($DocumentURL)"/>
>
> So I don't really believe that there is a solution to this but if anyone
> sees anything or has any ideas I would love to hear about it.

It would be good if you said what error message you get.  I tried this
syntax on a web site of mine.  The syntax succeeded using msxml3 and saxon,
but of course the url that was retrieved failed to parse.  The was clear
(and expected) from the error message.  You are trying to get an html file
and that will fail for the same reason.

On the other hand, the version of Xalan 1 that I tried claimed that the url
was malformed, and that's wrong.  That's a bug.

So you need to determine whether the operation fails because an html file is
not well-formed, or because the xslt processor has a problem with the url
syntax - which would be a bug because that syntax is correct.

Cheers,

Tom P


 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]