XSLT to convert from V-1.0 --> V-2.0

Paul Campbell paul at pauls.bsrg.dnsq.org
Wed Dec 5 10:04:36 PST 2001


flake at sedum.tommyk.com wrote:
> I should probably upload this to the LFS server and make at least a small note about it.  I haven't checked it out yet, but even if it's not perfect, it would be a big help I'm sure to many people.  I was thinking that someone might attemptsomething like this, but didn't know someone would do it so quickly!  :)

Neither did I (think it would hapen so quickly.)  The key was XSLT, which is
specifically designed for converting one form of XML to any other.

> 	*sigh* I still have to go over the DTD(s) posted a while back (now languishing in my inbox) and see about integrating that if for nothing more at the moment than having "correct" XML.  So much work to do..

Yes, I speak with recent experience in mind when I say, that the DTD are a
little flaky, or out of date.

I have been testing the output of the scripts and there are a few problems.

1.  Empty tags like <base/> and <pre/>  are produced, although a little more
work could fix this, it does not seem to be a major problem.

2.  More importantly, the <make> element no longer supports content as a
command, this again can be simply converted to an <execute> element instead,
like the <mount> element was.

( I'll work on this now, and upload and let you know. )

**** Inportant. ****

3.  The ENTITIES have the following issues.

	- The &foo; must be pre-escaped with & to stop the XSLT transformer
	resolving them, this can be done with "sed "s/\&/\&/" infile > outfile
	and un-done with sed "s/\&/\&/" processed > new.

	- The <!DOCTYPE is removed, so all entities vanish in the output.  This can
	easily by fixed something like "head -n256 old > finished && cat new >> finished"
	You still need to move the <?xml version="1.0"?> back to the top.


The output is very neat, but the comment pass through spoils the tree.  I will
remove it if you wish.  You won't have comments in the output but.

Finally, consider it alpha, I haven't got it to build yet, still a few teething
troubles, and I was maybe a little premature.  I don't see the point in making
it perfect to a fault as it should make it's poor wee self redundant very
quickly.

I will do a small xml write up (with the LFS dtd) and send it in if you want.
Just how to use it and the software (xalan) you need to run it.


> having "correct" XML. 

It is corrent XML, it's well formed and parses, it's just not Valid.  It makes
sense, considering there are many many documents and it is parsed by an
apllication, to make it conform to a Strict DTD and therefore be "Valid ALFSML"
*grin*


Oh.  How does a style sheet to split packages to individual files sound?  Maybe
if I find the time.

Cya

-- 
Paul
A farmer is a man, outstanding in his field.
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message



More information about the alfs-discuss mailing list