Jump to content

Processing text using XSL


ATM

Recommended Posts

Posted

Hey,I am trying to make an xsl stylesheet to process wikipedia text.for example <body>[[public transport]]</body>would be transformed into<body><a>public transport</a><body>I know I could do this in a number of different languages, but I would really like to do it in xsl for specific reasons.I have tried using transform function but have only been able to transform one character into another character, for example[[ into aaand the output is not as xml or html just raw text.Can anyone help me with this.Kind regardsRyan

Posted

XSLT 1.0 can't do this natively.With ELXST's str:replace you can perform a sort of regular expression replacement, and then, using the "disable-output-escaping" attribute in xsl:value-of, turn that into an actual element.XSLT 2.0, or should I say XPath 2.0, has a string replace functionality built in, again back to a string, and with a character map, you can emulate the disable-output-escaping attribute (which for legacy purposes is available in most implementations out there).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...