Hi all,
I'm new in xslt and xpath, so my question might be simple but i'm
learning.
I have an XML document and need to transform it into another XML, I use
xslt and it works, but there is a case that i don't know how to solve,
I need to concat a string from multiple childs into a standard way, the
following is an example of the source and the target XML.
Source:
<Root>
<ParentElementX >
<ChildElement >
<Value>1</Value>
<Value>2</Value>
<Value>3</Value>
<ChildElement >
<ChildElement >
<Value>4</Value>
<Value>5</Value>
<Value>6</Value>
<ChildElement >
</ParentElementX>
<ParentElementX >
<ChildElement >
<Value>1</Value>
<Value>2</Value>
<Value>3</Value>
<ChildElement >
</ParentElementX>
</Root>
Destination:
<Root>
<ParentElementX >
<ChildElement >1/2/3</ChildElement>
<ChildElement >4/56<ChildElement >
</ParentElementX>
<ParentElementX >
<ChildElement >1/2/3<ChildElement >
</ParentElementX>
</Root>
Please tell me what is the xslt code I need to write to transform this?
Thanks,
Zaid H. Safadi
I'm new in xslt and xpath, so my question might be simple but i'm
learning.
I have an XML document and need to transform it into another XML, I use
xslt and it works, but there is a case that i don't know how to solve,
I need to concat a string from multiple childs into a standard way, the
following is an example of the source and the target XML.
Source:
<Root>
<ParentElementX >
<ChildElement >
<Value>1</Value>
<Value>2</Value>
<Value>3</Value>
<ChildElement >
<ChildElement >
<Value>4</Value>
<Value>5</Value>
<Value>6</Value>
<ChildElement >
</ParentElementX>
<ParentElementX >
<ChildElement >
<Value>1</Value>
<Value>2</Value>
<Value>3</Value>
<ChildElement >
</ParentElementX>
</Root>
Destination:
<Root>
<ParentElementX >
<ChildElement >1/2/3</ChildElement>
<ChildElement >4/56<ChildElement >
</ParentElementX>
<ParentElementX >
<ChildElement >1/2/3<ChildElement >
</ParentElementX>
</Root>
Please tell me what is the xslt code I need to write to transform this?
Thanks,
Zaid H. Safadi
Comment