xsl-list
[Top] [All Lists]

Re: [xsl] Generating an internal subset?

2010-06-30 16:26:11
Just wondering if there is a better way to do this.

That's best you can do if you really need an internal subset.
(using pure xslt, saxon has an extension to do this I believe)
Better perhaps is use
<!DOCTYPE dmodule SYSTEM "local.dtd">

which you can generate using <xsl:output doctype-system="local.dtd"/>

then you just haave to write local.dtd to look like (in total)

      <!ENTITY % ISOEntities PUBLIC "ISO 8879-1986//ENTITIES ISO Character
Entities 20030531//EN//XML"
  "http://www.s1000d.org/S1000D_3-0/ent/xml/ISOEntities";>
      %ISOEntities;




Note though that if you do this (or what you suggested) any xml parser
using the file that you generate will (by default) need a network
connection to that server (or to the w3c server if you use the current
versions)

Yeah I have that problem when I try to process the files from the system
I'm trying to mimic. this may be a holdover from the SGML version of these
schemas for s1000D. Everything is managed by a CMS/CSDB and I'm not sure
what assumptions it makes, so I didn't want to loose the definition. My
editing environment uses XML catalogs and such to handle these files
locally, but my XSLT processing is hanging up on them.




If the file is being generated by XSLT, unless you go to a lot of
trouble with disable-output-escaping, it will nothave any entity
references in it, so you should not need to define any entities, so why
do you need to refer to these entity definitions?


Mainly so I don't have to figure out any dependencies in the commercial
CMS. This is what their templates generate. Maybe I will go ahead and file
a bug report with them. the editor we use can actually generate UTF-8,
numerical character entities or these named entities, so this may be the
way the CMS tries to handle the different combinations.

this was also an interesting exeercise as I hadn't thought about creating
an internal subset like this and had previously done this as you suggested
with the doctype-system parameter on <xsl:output>.

After sending this question, I came across the need to extract references
in the XML file to entity references and generate the following:

<!ENTITY RQ4-B-VTC-ECS1-CANCEL SYSTEM
"q:\csdb\graphics\library\vtc\ecs1\rq4-b-vtc-ecs1-cancel.cgm" NDATA cgm>
<!ENTITY RQ4-B-VTC-ECS1-ECSFANSFWD SYSTEM
"q:\csdb\graphics\library\vtc\ecs1\rq4-b-vtc-ecs1-ecsfansfwd.cgm" NDATA
cgm>
<!ENTITY RQ4-B-VTC-ECS1-MANCNTRL SYSTEM
"q:\csdb\graphics\library\vtc\ecs1\rq4-b-vtc-ecs1-mancntrl.cgm" NDATA cgm>
<!ENTITY RQ4-B-VTC-MAINT-ECS1 SYSTEM
"q:\csdb\graphics\library\vtc\maint\rq4-b-vtc-maint-ecs1.cgm" NDATA cgm>

So this actually prevent me from creating an external DTD as you suggested
as this list of entites is unique to a particular file and I can't
anticipate what the complete list might be.

..dan




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>