You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Frey, David" <DF...@nationaljournal.com> on 2005/03/17 23:44:59 UTC
DOCTYPE declaration with an external entity
We are creating a NewsML/NITF doc out of our process. The header of this
document needs to contain an entity statement. The very top of this
document should look like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE NewsML SYSTEM "http://nationaljournal.com/dtd/NewsML_1.2.dtd" [
<!ENTITY % nitf SYSTEM "http://nationaljournal.com/dtd/nitf-2-5.dtd">
%nitf;
]>
Currently I have been pulling the <!DOCTYPE> in by using a <doctype-system>
child tag of serializer:
<!-- 03.09.05.df newsml serializer -->
<map:serializer logger="sitemap.serializer.xml" mime-type="text/xml"
name="newsml" src="org.apache.cocoon.serialization.XMLSerializer">
<cdata-section-elements>p ul</cdata-section-elements>
<doctype-system>
http://nationaljournal.com/dtd/NewsML_1.2.dtd
</doctype-system>
<encoding>UTF-8</encoding>
</map:serializer>
<!-- 03.09.05.df END newsml serializer -->
I've scoured the web looking for an answer, but have come up short. Any
ideas on how to accomplish this?
Best,
David
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: DOCTYPE declaration with an external entity
Posted by Geert Josten <Ge...@daidalos.nl>.
Hi,
Not an advisable approach in Cocoon (SAX) context, and only working in the case you don't need that
doctype info inside Cocoon:
Use an XSL to add prolog info with <xsl:text disable-output-escaping="yes">..
Not advisable because the text is not 'unescaped' until actually serialized.
Cheers,
Geert
Frey, David wrote:
> Thank you for the input Conal. That is definitely on way to handle the
> problem! We were hoping to have a solution that would generate the same
> output as the listing given since we have been generating content with that
> header - for consistency - but this would seem to definitely work.
>
> Thanks again for your time and interest!
>
> Best,
>
> David
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: DOCTYPE declaration with an external entity
Posted by "Frey, David" <DF...@nationaljournal.com>.
Thank you for the input Conal. That is definitely on way to handle the
problem! We were hoping to have a solution that would generate the same
output as the listing given since we have been generating content with that
header - for consistency - but this would seem to definitely work.
Thanks again for your time and interest!
Best,
David
On 3/17/05 7:22 PM, "Conal Tuohy" <co...@paradise.net.nz> wrote:
> David Frey wrote:
>
>> We are creating a NewsML/NITF doc out of our process. The header of this
>> document needs to contain an entity statement. The very top of this
>> document should look like this:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE NewsML SYSTEM "http://nationaljournal.com/dtd/NewsML_1.2.dtd" [
> <!ENTITY % nitf SYSTEM "http://nationaljournal.com/dtd/nitf-2-5.dtd">
> %nitf;
> ]>
>
> I don't know about how to serialize your XML with an internal DTD (to
> include the nitf-2-5.dtd).
>
> But it seems to me you could define a 3rd DTD file, consisting simply of
> references to the NewsML and NITF DTDs, and use THAT DTD file as doctype.
> i.e. you'd be amalgamating these two DTDs using a 3rd (external) DTD, rather
> than trying to do it using the internal DTD in your instance documents.
>
> HTH!
>
> Con
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: DOCTYPE declaration with an external entity
Posted by Conal Tuohy <co...@paradise.net.nz>.
David Frey wrote:
> We are creating a NewsML/NITF doc out of our process. The header of this
> document needs to contain an entity statement. The very top of this
> document should look like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE NewsML SYSTEM "http://nationaljournal.com/dtd/NewsML_1.2.dtd" [
<!ENTITY % nitf SYSTEM "http://nationaljournal.com/dtd/nitf-2-5.dtd">
%nitf;
]>
I don't know about how to serialize your XML with an internal DTD (to
include the nitf-2-5.dtd).
But it seems to me you could define a 3rd DTD file, consisting simply of
references to the NewsML and NITF DTDs, and use THAT DTD file as doctype.
i.e. you'd be amalgamating these two DTDs using a 3rd (external) DTD, rather
than trying to do it using the internal DTD in your instance documents.
HTH!
Con
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org