You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Michael Engelhart <me...@navigatus.com> on 2002/05/31 19:17:12 UTC
URI help
I have a project where I need to post XML data to a web services URL to get
XML data. The sample code the company whose services I need to access uses
XML as the payload of a single http 'get' parameter called xml.
So for example a request URL to get an XML document from them would be
something like:
http//the.company.com/xmlInterface.jsp?xml=<Request><var1>abcdedfg</var1></R
equest>
In Java I can create a URL using
URL url = new
URL("http//the.company.com/xmlInterface.jsp?xml=<Request><var1>abcdedfg</var
1></Request>");
And javac doesn't balk. But when I try to do this in Xalan, I have all
sorts of errors relating to invalid characters in a URI.
Does anyone have any way around this? I've tried using
java.net.URLEncoder.encode() but that doesn't work either.
I've also tried CDATA'ing out and escaping the <> characters but that also
doesn't work.
Basically what I need to do is this:
<xsl:copy-of
select="document('http//the.company.com/xmlInterface.jsp?xml=<Request><var1>
abcdedfg</var1></Request>') />
When I do this, I get the following error:
(Location of error unknown)XSLT Error
(javax.xml.transform.TransformerException):
javax.xml.transform.TransformerException:
org.apache.xml.utils.URI$MalformedURIException: Query string contains
invalid character:<
Any ideas?
Thanks
Mike