Lei,
Thanks for taking the time to respond. I've read a
bit about JAXP and was generally aware of this
approach. The problem I'm having though is that I
can't find any org.apache.xerces.jaxp
packages/classes. Could it be that they were only
added to a later implementation of xerces? Thanks
again for the input.
-Jason
--- Lei Chen <[EMAIL PROTECTED]> wrote:
> There does exist a non implementation specific way
> for creating a document
> -- JAXP 1.1. With JAXP 1.1, you can achieve your
> goal by doing following:
>
> ...
> import javax.xml.parsers.DocumentBuilder;
> import javax.xml.parsers.DocumentBuilderFactory;
> ...
> DocumentBuilderFactory factory =
> DocumentBuilderFactory.newInstance();
> DocumentBuilder builder =
> factory.newDocumentBuilder();
> Document doc = builder.newDocument();
> Element ele = doc.createElement("test");
> doc.appendChild(ele);
>
> Then at deployment time, you can specify which
> parser to use by setting
> system properties like this (assume you are using
> Xerces):
>
> java
>
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactory
> Impl
>
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBu
> ilderFactoryImpl YourClass
>
> By default, the factories are
> org.apache.crimson.jaxp.SAXParserFactoryImpl
> and
> org.apache.crimson.jaxp.DocumentBuilderFactoryImpl.
>
> For more details go to http://java.sun.com/xml/
>
> -Lei
>
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]