xml - XSL string parsing and getting value with a bid oddity -


been fighting xml beginner, , result have have work with. xml being returned following:

<response .... />   <metric ... />      <stuff .... />      <stuff  .... sname="on"  tag="parameters: (@sid: dftdr.23423.s1.rt, @stype: x)" /> 

well trying output select parameters , sid value there. display in example, parameters dtfdr.23423.s1.rt . got 1 half of done doing this:

<xsl:value-of select="substring(/response/metric/stuff[@sname='on'][1]/@tag, 1, 9)"/>   

but can't think of way parse sid out dynamic value getting length. can start position can't seem figure out , easy indexof concept "," or if there's better way this.

this base xml it's cards dealt, can't change it.

is there easier way write out buried @sid value?

much help, hope explained enough.

try expression parse out sid

<xsl:value-of select="substring-before(substring-after(/response/metric/stuff[@sname='on'][1]/@tag, '@sid: '), ',')"/>  

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -