Subject: Re: Translating header information between XML files with Jade From: Brandon Ibach <bibach@xxxxxxxxxxxxxx> Date: Wed, 22 Mar 2000 13:51:46 -0600 |
Quoting Thomas_M_Magee@xxxxxxxxxxxx <Thomas_M_Magee@xxxxxxxxxxxx>: > Hi all, > > I am relatively new to jade, and I am trying to write DSSSL style sheets for > an XML to XML transformation using jade. My question is, is there any way to > handle the translation of the file header information between XML documents? > > [...] > > I know how to process the various elements in the document, but is there any > simple way in the DSSSL style sheet to translate the header information when > you generate the new XML document? What would I write in the style sheet if > I wanted the header information to look like this in the new document: > > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE article PUBLIC "-//Vanguard//DTD Extended DocBk30 New Full > Speech V1.0//EN" "file:///s:/.../new_vanguard.dtd"> > > It would be easy to write a perl script to do this, I know, but I was > wondering if this could be handled on the style sheet level. > Of course! :) You'd be amazed what all is contained in the grove. Check out: http://www.hytime.org/materials/sgmlpropset/index.html This is a *very* nice presentation of the SGML Property Set, which defines the structure and content of the grove that is available to your DSSSL stylesheet. The "prolog" property of the grove root is a node-list containing, among other things, any PIs occurring before the start of the document element. So, if you were to traverse this list, the first PI you find would probably be the XML declaration (though you could be very sure by comparing the first four characters of it to "xml "). The DOCTYPE, on the other hand, could be somewhat more difficult. The "governing-doctype" property of the grove root is a node which contains quite a lot of information about the document type. You could get the name ("article", in this case), but I think the rest of the information you'd need, namely the PUBLIC and SYSTEM identifiers, are part of the "prolog sgml document string" (prlgsds) module of the SGML Property Set, which Jade/OpenJade do not currently provide. -Brandon :) DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Translating header information betw, Thomas_M_Magee | Thread | Which elements can be changed in Do, G . B . Stott |
Which elements can be changed in Do, G . B . Stott | Date | Re: Which elements can be changed i, Brandon Ibach |
Month |