Forum Moderators: open
xml looks like..
<array>
<month name="MONTH_NAME"
pattern="January(1) February(2) March(3) April(4) May(5) June(6) July(7) August(8) September(9) October(10) November(11) December(12)"
help="Month of the year"/>
</array>
I would like an html table like.
Month Value
January 1
February 2
..
..
December 12
Thanks much!
A better pattern would be:
<array name="MONTH_NAME">
<array_help>Month of the year</array_help>
<array_values>
<array_value value="1">January</array_value>
<array_value value="2">February</array_value>
<array_value value="3">March</array_value>
<array_value value="4">April</array_value>
<array_value value="5">May</array_value>
<array_value value="6">June</array_value>
<array_value value="7">July</array_value>
<array_value value="8">August</array_value>
<array_value value="9">September</array_value>
<array_value value="10">October</array_value>
<array_value value="11">November</array_value>
<array_value value="12">December</array_value>
</array_values>
</array>
You will need to use XPath [w3schools.com] to do most of the parsing. The function you will probably need will be here [w3schools.com].
XSLT will get you on the green, but you won't be able to use it to sink your putt.
However, XPath 1.0 completely stinks at string parsing. I mean really bad. If you will be using PHP XSLTProcessor [us2.php.net], you need to keep to XPath 1.0 [w3.org] functions. You are better off doing a PHP callout [us2.php.net], or even using PHP DOMDocuments [us2.php.net].
Whomever designed that XML didn't really understand how to use XML properly, so they really limited your options.