xsl-list
[Top] [All Lists]

[xsl] [xslt] xslt problem

2009-03-19 04:39:43
Hello guys,

I have following XML:

<example>
    <someNode>
            <value>asas</value>
            <name>asas</name>
            <space>12</space>
    </someNode>
    <interestingNode>
            <con>someString</con>
            <follow>
                    <node1>1</node1>
                    <node2>2</node2>
                    <node3>3</node3>
                    <node4>4</node4>
            </follow>
            <space>5</space>
    </interestingNode>
</example>


Now i want to transform it to:

<example>
    <someNode>
            <value>asas</value>
            <name>asas</name>
            <space>12</space>
    </someNode>
    <interestingNode>
            <con>someString</con>
            <follow>
                    <return>0</return>
            </follow>
            <space>5</space>
    </interestingNode>

    <node1 space="5">1</node1>
    <node2 space="5">2</node2>
    <node3 space="5">3</node3>
    <node4 space="5">4</node4>
</example>


The changes are:
- when interestingNode is found, we check the con value
- if con value conforms someString, then we make transformation of this part by:
    - evrything in follow node is moved outside interestingNode
    - follow node gets one child return
    - all nodes moved outside get an attribute space with value
specified in original node


I have problems with that cross-referancing to the nodes. Can you help me?

Thanks!

--~------------------------------------------------------------------
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>