I have ran into an issue with another engineer. Being a new engineer, I have to figure out the solution to this, but I haven't been able to. Any help would be appreciated, the closest thing I've found is Chunk string with XSLT but is still not quite there. I'm only able to use XSL v1.0.
A parameter is passed to my stylesheet as a giant string. It originally came from an XML Document. The string looks something like this.
With <xsl:value-of select="$servers"/>
where $servers
is the param for the string passed to me. The string looks like this:
<license><active_servers><server><name>MIKE</name><capacity>18</capacity><status>0</status><expiration></expiration><left>0</left><comment></comment></server><server><name>Susie</name><capacity>0</capacity><status>1</status><expiration>2014-07-04T00:00:00Z</expiration><left>5238568</left><comment></comment></server><server><name>Zoe</name><capacity>5000</capacity><status>1</status><expiration></expiration><left>0</left><comment></comment></server></active_servers></license>
This is a section of the xml data passed as a param to the stylesheet. The actual document is 300 or so lines of data. The only distinctive thing that separates these "nodes" are the <server>
and </server>
. Is there a way to pull data out of this if it's a really big string?
Say, for example. I need to find "Zoe" and see if she has a "expiration", if she doesn't, I need her "status". So Zoe will display "1" for status since she doesn't have expiration. While MIKE will display "0" and Susie will display 2014-07-04T00:00:00Z.
I have looked all over google and stack overflow for finding a solution to parsing/reading a giant string. But I haven't come to a solution close enough where I can make it work. As of right now, I'm stuck having no working copy, and 2 days into research without getting anywhere.