Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Parsing LSCS results
Bowker
I'm stumped on this one.
In an XSL component I have:
<xsl:variable name="searchString">(a valid LSCS search string</xsl:variable>
<xsl:variable name="RESULTS" select="document($searchString)"/>
When I do <xsl:copy-of select="$RESULTS"/> I get back:
(paraphrasing here)
<results>
<assets>
<document>
lots of data about the document
</document>
<document>
lots of data about the document
</document>
</assets>
</results>
When I do <xsl:value-of select="count($RESULTS/results)">
I get back 0.
When I do <xsl:value-of select="count($RESULTS/descendant::*[name()='results'])"/> I get back 1
When I do
<xsl:for-each select="$RESULTS/*">
"<xsl:value-of select="name()"/>"
</xsl:for-each>
I get back: "results"
I've been doing XSLT for a decade plus and have never seen anything like this. Has anyone else run into parsing issues from results coming back from LSCS?
Find more posts tagged with
Comments
Bowker
Okay - so we have found the cause, but not the fix.
My abbreviated example was too abbreviated. The tag is actually:
<results xmlns="
http://www.interwoven.com/schema/iwrr"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.interwoven.com/schema/iwrr
iwrr.xsd" total="2" included="2" start="0" status="200">
The xmlns, xmlns:xsi and xsi:schemaLocation attributes are messing me up.
Anyone know how to deal with these attributes? How to form an XPath statement to read the content? Or get LSCS to omit those attributes.
Bowker
Well I've had a crash course on namespaces and changing the default name space.
This will parse the results coming back from lscs:
(Notice I have given the namespace for search results the arbitrary name "lscs".
[PHP]
xmlns:lscs="
http://www.interwoven.com/schema/iwrr"
exclude-result-prefixes="lscs">
Number found = "
"
DCR found:
Creation Date:
[/PHP]