Using EXSLT regexp (oXygen and EXSLT)
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 3
- Joined: Sun May 24, 2009 8:45 pm
Using EXSLT regexp (oXygen and EXSLT)
Hi,
I read Sorin's response on using EXSLT with oXygen, however it's still not clear on how exactly xsl needs to be adopted so that EXSLT regexp will work in transformation scenario with Xalan. For example below are xml and xsl containing regexp example from EXSLT web site. This example works just fine in Firefox (by opening xml file below)
XML:
XSL (save it as regexp_firefox_01.xsl):
I added bsf.jar and js.jar as XSLT extensions to the oXygen transformation scenario. However it's not clear how exactly XSL above needs to be modified so it will work in Oxygen. Can someone post modified XSL example and detailed description of other steps required (e.g. adapted JavaScript code from the EXSLT stylesheets) so it will work?
Much appreciated.
I read Sorin's response on using EXSLT with oXygen, however it's still not clear on how exactly xsl needs to be adopted so that EXSLT regexp will work in transformation scenario with Xalan. For example below are xml and xsl containing regexp example from EXSLT web site. This example works just fine in Firefox (by opening xml file below)
XML:
Code: Select all
<?xml version="1.0" ?>
<?xml-stylesheet href="regexp_firefox_01.xsl" type="text/xsl"?>
<urls>
<url>http://www.bayes.co.uk:8080/xml/index.xml?/xml/utils/rechecker.xml</url>
</urls>
Code: Select all
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:regexp="http://exslt.org/regular-expressions"
extension-element-prefixes="regexp">
<xsl:output method="html" />
<xsl:template match="url">
<xsl:variable name="an_url" select="." />
<body>
<html>
<ul>
<li>string:</li>
<ul><li><xsl:value-of select="$an_url" /></li></ul>
<xsl:for-each select="regexp:match($an_url, '(\w+):\/\/([^/:]+):?(\d*)?([^# ]*)', 'i')">
<li>position <xsl:value-of select="position()" /></li>
<ul><li><xsl:value-of select="." /></li></ul>
</xsl:for-each>
</ul>
</html>
</body>
</xsl:template>
</xsl:stylesheet>
Much appreciated.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Using EXSLT regexp (oXygen and EXSLT)
Post by sorin_ristache »
Hello,
Regards,
Sorin
Xalan implements a subset of the EXSLT functions but this subset does not include the regexp functions. You have to import an XSLT stylesheet that implements the EXSLT regexp functions.andrei wrote:it's still not clear on how exactly xsl needs to be adopted so that EXSLT regexp will work in transformation scenario with Xalan
Regards,
Sorin
-
- Posts: 3
- Joined: Sun May 24, 2009 8:45 pm
Re: Using EXSLT regexp (oXygen and EXSLT)
Can you please give a working example for xslt that I posted above (I assume that stylesheet is part of ESLT downloads, not sure which one though)? I am using oXygen on Mac OS X. Much appreciated.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Using EXSLT regexp (oXygen and EXSLT)
Post by sorin_ristache »
You should just follow the example of using the regexp extensions. Just import the stylesheet from EXSLT and use the functions that you need.
Regards,
Sorin
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service