Hi Lea

I explicitly added a JUnit test case to check that there wasn't a bug in
there somewhere. Its in dom4j/src/test/org/dom4j/TestContent.java if you
fancy taking a look - the testOrderOfPI() method.

The answer ot your question depends on how you're building your document. If
you're just parsing your document it should just work. If you are creating a
document programatically then the following code (taken from the above JUnit
test) should work fine...

        Document document = factory.createDocument();
        document.addProcessingInstruction( "xml-stylesheet",
"type=\"text/xsl\" href=\"...\"" );
        document.addElement( "root" );

        List list = document.content();
        Object pi = list.get(0);
        Object root = list.get(1);

        assertTrue( "First element is a PI", pi instanceof
ProcessingInstruction );
        assertTrue( "Second element is an element", root instanceof
Element );

James
----- Original Message -----
From: "Lea Allison" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 7:01 AM
Subject: [dom4j-user] stylesheet preprocessor inclusion


> Hi
>
> whenever I try to include the stlesheet preprocessor line I get it at the
> bottom of the document. Is how do I get it to go at the top??
>
>
> eg:
>
> <?xml version="1.0" ?>
> <?xml-stylesheet type="text/xsl" href="..." ?>
>
> <DOCSTART>
> ...
>
>
>
>
> Thanks
>
> Lea
>
> _______________________________________________
> dom4j-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dom4j-user


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to