xsl-list
[Top] [All Lists]

RE: group-starting-with problem

2005-12-12 13:18:29
My input:

<xsl:variable name=element_definition_lines">

    <element>
     <line>REQUIRED ST01</line>
     <line>Code uniquely identifying a Transaction Set</line>
     <line>REQUIRED</line>
     <line>REQUIRED ST02</line>
     <line>Identifying control number that must be unique within the
transaction set</line>
    </element>

</xsl:variable>

The type of this variable is document-node(elemnet(element)): that is, a
document node whose child is an element named "element".

The path expression $element_definition_lines/line selects the children of
this document node that are named "line", and there aren't any.

I've tried the following code:

<xsl:for-each-group select="$element_definition_lines/line"
group-starting-with="REQUIRED " >

Please note the space in the group-starting-with attribute.  

The group-starting-with attribute is a match pattern. Your pattern is
matching elements named REQUIRED. To match elements whose string value is
"REQUIRED ", use group-starting-with="line[.='REQUIRED ']". To match
elements whose string value starts with "REQUIRED ", use
group-starting-with="line[starts-with(.,'REQUIRED)]"

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>