Sally Nemes wrote:
> I am trying to generate an XML file that has  2 processing instructions at
> the beginning of it
> before the root:
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="c:\abc.xslt">

The first is not a processing instruction, even though it
looks like one. It is the XML Declaration as defined by
the XML specification. Therefore, you should not try to
create a processing instruction with the target name of
"xml".

> Document doc = new Document();
> ProcessingInstruction pi = doc.createProcessingInstruction
> ("xml-stylesheet", "type=text/xsl href=c:\abc.xslt">
> doc.appendChild(pi);
> 
> Unfortunately I get errors using this method and several other ways that I
> tried. Can you suggest a solution?

Please explain the error you are getting and include a
stack-trace if possible. Also, you need to escape the 
backslash in your code (e.g. "c:\\abs.xslt").

-- 
Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to