xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris <k...@bellatlantic.net>
Subject Re: Getting Doctype Declaration under Xerxes-j
Date Fri, 17 Nov 2000 15:40:18 GMT
Hello, Gagan,
   This is how I specified a DTD -- I'm sure there are other ways.  But I was
serializing my document.  This is because I couldn't get Xalan's XSLT processor
to accept a node (document) as an input parameter, even though their
documentation says it can.  It would take an input stream, however.



                                 // Create a new XML document
   DocumentImpl doc = new DocumentImpl();
---
---
---
   OutputFormat dom_format    = new OutputFormat(doc,"UTF-8",true);

                              // Set the <!DOCTYPE> info -- with DTD
   dom_format.setDoctype(null,"/web/docs/cafe/DTD/trend_report.dtd");

                             // Where the serializer will put output.
   serialized_output = new ByteArrayOutputStream();

                             // Create a new serializer.
   XMLSerializer serial = new XMLSerializer(serialized_output, dom_format);

                             // Use a DOM serializer interface.
   serial.asDOMSerializer();

                             // Do the serialization,using
                             // element of document 'doc'.
   serial.serialize(doc.getDocumentElement());

   xml_stream = new ByteArrayInputStream(serialized_output.toByteArray());

--Kris

Gagan Gaur wrote:

> Hi,
> I have similar problem as yours. Only probelm is I want to specify a DTD for
> the XML Document.
> I have a InputSource to an XML file in directory and I am using DOMParser to
> parse that InputSource and then using the getDocument method to return an
> XML Document Object. My problem is, before I parse, I want to specify a DTD.
> Any help is appreciated.
> Thanks,
> Gagan Gaur
> ----- Original Message -----
> From: <Frank.Schoenfelder@e-pro.de>
> To: <general@xml.apache.org>
> Sent: Tuesday, November 14, 2000 10:51 AM
> Subject: Re: Getting Doctype Declaration under Xerxes-j
>
> From: Frank.Schoenfelder@e-pro.de on 11/14/2000 03:51 PM GMT
>
> Please respond to general@xml.apache.org
>
> To:   general@xml.apache.org
> cc:
> Subject:  Re: Getting Doctype Declaration under Xerxes-j
>
> Thanks.
> I solved the problem yet.
> I used the Class EntityResolver.
> Many Thanks for your help.
>
>                     "Joe Sabu"
>                     <Joe.Sabu@dot        To:     <general@xml.apache.org>
>                     hill.com>            cc:
>                                          Subject:     Re: Getting Doctype
> Declaration under Xerxes-j
>                     14.11.00
>                     16:26
>                     Please
>                     respond to
>                     general
>
> Check out Document.getDoctype().getSystemId()
>
> Hope it helps.
> Joe Sabu
> ----- Original Message -----
> From: <Frank.Schoenfelder@e-pro.de>
> To: <general@xml.apache.org>
> Sent: Tuesday, November 14, 2000 3:48 AM
> Subject: Getting Doctype Declaration under Xerxes-j
>
> Hello!
> I have this little problem that i want to know the name
> of my DTD-File denoted in my XML File.
> It also should by possible to get this information before
> the parse process.
> Can anyone tell me how i´ll be able to obtain this?
> Oh, by the way, i´m working with Java and Xerxes 1.2.1.
> Thanks in advance.....
>
> ---------------------------------------------------------------------
> 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
>
> ---------------------------------------------------------------------
> 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

Mime
View raw message