You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by yudo pria <yu...@rileks.co.id> on 2001/08/14 11:54:26 UTC

generate XML on the fly

i'm new on this stuff,
and i have a problem when i tried to transform dynamic xml
into html.

i've tried servlet samples packed on xalan-j_2_2_d6.zip
named SimpleXSLTServlet.java.
the code works so fine.

but, in my case, i have thousands elements (products),
so i think it's not a good solution
if i have to generate thousand products into files,
because it means thousands xml files.

so i modify the code on this line :

Source xmlSource = new StreamSource(new URL("file:todo.xml").openStream());

into this line :

Source xmlSource = new StreamSource(new
URL("http://myhost/productXML.cfm?detailID=1891").openStream());

it compiled successfully,
but it returns an error on running :
(i only paste a few first lines)

The markup in the document preceding the root element must be
well-formed.javax.xml.transform.TransformerException: The markup in the
document preceding the root element must be well-formed. void
org.apache.xalan.transformer.TransformerImpl.transform(javax.xml.transform.S
ource, javax.xml.transform.Result, boolean) void
org.apache.xalan.transformer.TransformerImpl.transform(javax.xml.transform.S
ource, javax.xml.transform.Result)

what could be wrong ?
i'm sure the xml is well formed,
because productXML.cfm? runs with no error on MSXML.
and
it works fine when i save the output of
http://myhost/productXML.cfm?detailID=1891
as an .xml file, and I use the xml file to feed the code above.

please ...
i need some help.

thank you,
yudo.


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: generate XML on the fly

Posted by Gary L Peskin <ga...@firstech.com>.
If it works fine when you save it, about all I can suggest is looking at
things in a debugger to see what Xalan (actually, I think this error
comes from Xerces) sees.  You might also run a socket trace to try to
see what's actually coming over the "wire".

Gary

yudo pria wrote:
> 
> i'm new on this stuff,
> and i have a problem when i tried to transform dynamic xml
> into html.
> 
> i've tried servlet samples packed on xalan-j_2_2_d6.zip
> named SimpleXSLTServlet.java.
> the code works so fine.
> 
> but, in my case, i have thousands elements (products),
> so i think it's not a good solution
> if i have to generate thousand products into files,
> because it means thousands xml files.
> 
> so i modify the code on this line :
> 
> Source xmlSource = new StreamSource(new URL("file:todo.xml").openStream());
> 
> into this line :
> 
> Source xmlSource = new StreamSource(new
> URL("http://myhost/productXML.cfm?detailID=1891").openStream());
> 
> it compiled successfully,
> but it returns an error on running :
> (i only paste a few first lines)
> 
> The markup in the document preceding the root element must be
> well-formed.javax.xml.transform.TransformerException: The markup in the
> document preceding the root element must be well-formed. void
> org.apache.xalan.transformer.TransformerImpl.transform(javax.xml.transform.S
> ource, javax.xml.transform.Result, boolean) void
> org.apache.xalan.transformer.TransformerImpl.transform(javax.xml.transform.S
> ource, javax.xml.transform.Result)
> 
> what could be wrong ?
> i'm sure the xml is well formed,
> because productXML.cfm? runs with no error on MSXML.
> and
> it works fine when i save the output of
> http://myhost/productXML.cfm?detailID=1891
> as an .xml file, and I use the xml file to feed the code above.
> 
> please ...
> i need some help.
> 
> thank you,
> yudo.
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org