xml - Looping results in xsl-fo with same node -


I am having trouble using JSL-FO to correctly display the selected values ​​in the loop.

As you can see in XML, each & lt; Firstname & gt; For many & lt; Visit & gt; are nodes. I can call each & lt; Visit & gt; Trying to display the value in a faw: block tag, but at the moment it only displays all those for one: block which adds values ​​to squash with a line and I Can not understand

XSL:

  & lt; Xsl: template match = "/" & gt; & Lt; Xsl: each selection = "company / employee" & gt; & Lt; To: Block & gt; & Lt; Xsl: select value = "@ id" /> & Lt; For /: Block & gt; & Lt; Xsl: each selection = "first name" & gt; & Lt; To: Block & gt; & Lt; Xsl: Select the value = "@ name" /> & Lt; For /: Block & gt; & Lt; To: Block & gt; & Lt; Xsl: value selection = "." / & Gt; & Lt; For /: Block & gt; & Lt; / XSL: for-each & gt; & Lt; / XSL: for-each & gt; & Lt; / XSL: Templates & gt;   

XML: & lt; Company & gt; & Lt; Employee id = "1" & gt; & Lt; First name = "name_1" & gt; & Lt; Tour & gt; LOCATION_1 & lt; / Visit & gt; & Lt; Tour & gt; Location_2 & lt; / Visit & gt; & Lt; Tour & gt; Location_3 & lt; / Visit & gt; & Lt; Tour & gt; Location_4 & lt; / Visit & gt; ... & lt; / Firstname & gt; & Lt; First name name = "name_2" & gt; & Lt; Tour & gt; LOCATION_1 & lt; / Visit & gt; ... & lt; / Firstname & gt; & Lt; / Employees & gt; & Lt; Employee id = "2" & gt; ... & lt; / Staff & gt; & Lt; / Company & gt;

You have to wrap the code that is currently fo: block one xsl: for-each so that it goes to each separate node, not only first:

  & Lt; Xsl: each selection = "first name" & gt; & Lt; To: Block & gt; & Lt; Xsl: Select the value = "@ name" /> & Lt; For /: Block & gt; & Lt; Xsl: each selection = "visited" & gt; & Lt; To: Block & gt; & Lt; Xsl: value selection = "." / & Gt; & Lt; For /: Block & gt; & Lt; / XSL: for-each & gt; & Lt; / XSL: for-each & gt;    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -