[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Weird problem with doc()

Subject: Re: Weird problem with doc()
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 30 May 2022 03:19:23 -0000
Re:  Weird problem with doc()
On Mon, May 30, 2022 at 03:01:11AM -0000, Mark Giffin
m1879@xxxxxxxxxxxxx scripsit:
> Using XSLT 2.0, I'm using doc() to access data in an outside XML file.
> This is running inside the DITA Open Toolkit, which is an Apache Ant
> application. doc() accesses the whole file and displays the text
> content of elements when I do this:
> 
> <xsl:message>OUTSIDE FILE - <xsl:value-of
> select="doc('file:/C:/Users/mark/test
> /publicationoutput.xml')"/></xsl:message>

> This is expected. But when I add some XPath to get to certain data inside the
> file like below, the output goes blank:
> 
> <xsl:message>OUTSIDE FILE - <xsl:value-of select="doc('file:/C:/Users/mark/test
> /publicationoutput.xml')//ishfield[@name = 'FTITLE']"/></xsl:message>
> 
> The XPath is correct because I can run this exact code outside of the DITA Open
> Toolkit and it works as expected. I realize there is a lot going on inside the
> DITA OT but I'm just curious what kind of thing could cause this strange
> behavior of doc() being able to access the file, but failing with XPath. There
> is no error reported.

You should be getting a text node with content formed from the string
values of the ishfield elements making up the sequence of ishfield
elements where the name attribute value is FTITLE separated by spaces.

Are you sure the ishfield elements have string values? (that is,
descendent text nodes?)

What happens when you replace value-of with sequence?

-- 
Graydon Saunders  | graydonish@xxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.