[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Basic template matching issues - I think?

Subject: Re: Basic template matching issues - I think?
From: Ihe Onwuka <ihe.onwuka@xxxxxxxxx>
Date: Tue, 20 Nov 2012 12:37:56 +0000
Re:  Basic template matching issues - I think?
.......after you have fixed everything else that has been mentioned.

On Tue, Nov 20, 2012 at 12:34 PM, Ihe Onwuka <ihe.onwuka@xxxxxxxxx> wrote:
> I think you have fallen foul of this.
>
> http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/201211/msg00133.html
>
> On Tue, Nov 20, 2012 at 12:28 PM, An OldBloke <neil_owens@xxxxxxxxxxx> wrote:
>>
>> I'm getting the following error trying to integrate regex into a transform that previously used concat and string searching as it's much more flexible.
>>
>> The error is:-
>>
>> C:\>java -jar saxon9he.jar -o Result.xml text.xml regextime.xslt
>>
>> Error on line 22 column 5 of regextime.xslt:
>>   SXXP0003: Error reported by XML parser: The value of attribute "select" associated with an
>>   element type "null" must not contain the '<' character.
>> Failed to compile stylesheet. 1 error detected.
>>
>> I just can't see what I've done wrong, so am hoping you kind folks can put me on the (x)path again.
>>
>> XML file:
>> <Log Device="SERVER1">
>> <myCommand Command="test" Time="12/11/2012 11:12:04 AM" Port="9999" IP="1.1.1.1">
>> <Struct>
>> <OUTID>SERVER2</OUTID>
>> <INID>SERVER3</INID>
>> <test>
>> <item>2</item>
>> <GUID>21EC2020-3AEA-1069-A2DD-08002B30309D</GUID>
>> <status>OK</status>
>> </test>
>> </Struct>
>> </myCommand>
>> </Log>
>>
>>
>> xsl Transform:
>> <?xml version="1.0"?>
>> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>> <xsl:output method="xml" indent="yes" name="TextFormat" omit-xml-declaration="yes"/>
>>
>> <xsl:template match="Log">
>>     <xsl:apply-templates select="myCommand"/>
>> </xsl:template>
>>
>> <xsl:template match="myCommand">
>>     <nomCommand>
>>         <xsl:element name="Command"><xsl:value-of select="@Command"/></xsl:element>
>>         <xsl:template match="Time">
>>         <xsl:analyze-string select="@Time" regex="(\d{2})\/(\d{2})\/(\d{4}) (\d{1,2}):(\d{2}):(\d{2})">
>>             <xsl:matching-substring>
>>                 <xsl:value-of select="concat(string(number(regex-group(3))), '-',
>>                                  string(number(regex-group(2))), '-',
>>                                  string(number(regex-group(1))), 'T',
>>                                  format-number(regex-group(4), '00'), ':',
>>                                  regex-group(5), ':',
>>                                  regex-group(6) />
>>             </xsl:matching-substring>
>>         </xsl:analyze-string>
>>         </xsl:Template>
>>         <xsl:element name="Port"><xsl:value-of select="@Port"/></xsl:element>
>>     </nomCommand>
>> </xsl:template>
>> </xsl:stylesheet>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.