[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Processing text in XSL


Subject: RE: [xsl] Processing text in XSL
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Mon, 10 Jan 2005 11:17:05 -0000

> I would like to transform an XML document with XSL but I
> would like to change all text nodes and attribute values
> before starting the XSL transformation. For example, I would
> like to change all text nodes and attribute values to
> uppercase. I know I can do this in the XSL sheet but is there
> a way to do this at the SAX level?

Yes - but as it doesn't involve XSLT it's a bit off topic for this list.
You could do it in XSLT as a two-pass transform in the same stylesheet:
perform an identity transform in a top-level variable that converts
attribute values and text nodes to uppercase, and then in your root
matching template apply-tempaltes on that variable.

If you really want to do it at the SAX level, I would recommend looking
up SAXTransformerFactory first and work from there. Basically you want
to write an XMLFilter and chain it between an XMLReader and a
TransformerHandler.

cheers
andrew


Current Thread
Keywords