|
Subject: [xsl] Using xsl:analyze-string and regex to parse long lines with white-space From: Rob Newman <rlnewman@xxxxxxxx> Date: Tue, 19 Jun 2007 11:38:54 -0700 |
output.xml --------------- <dlsites> <site name="TA_D03A"> <comt>regular internet</comt> <comp>hosted</comp> </site> <site name="TA_HAST"> <comt>regular internet</comt> <comp>hosted</comp> </site> <site name="TA_U04C"> <comt>vsat</comt> <comp>spacenet</comp> </site> </dlsites>
transform.xsl ----------------- <?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:template match="/">
<dlsites>
<xsl:apply-templates select="/pfarr/pfstring" />
</dlsites>
</xsl:template><xsl:template match="pfstring[@name = 'dlsite']">
<xsl:variable name="elValue" select="." /> <xsl:matching-substring>
<xsl:variable name="dlname" select="regex-group(5)" />
<site name="{@dlname}">
<comt><xsl:value-of select="regex-group(10)"/></comt>
<comp><xsl:value-of select="regex-group(11)"/></comp>
</site>
</xsl:matching-substring> <xsl:non-matching-substring>
<unknown>
<xsl:value-of select="$elValue"/>
</unknown>
</xsl:non-matching-substring>Thanks in advance! - Rob Newman
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] XSLT Encryptt Image URL, Mukul Gandhi | Thread | Re: [xsl] Using xsl:analyze-string , Abel Braaksma |
| Re: [xsl] Dynamic pipelining in XSL, M. David Peterson | Date | Re: [xsl] Using xsl:analyze-string , Abel Braaksma |
| Month |