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

doc() concat expression and whitespace error

Subject: doc() concat expression and whitespace error
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Mon, 15 Nov 2004 20:16:19 -0500
whitespace required before attributes
I'm working on pulling in -- using the doc() function -- documents from the eXist XML DB via it's http interface.

Here's my template:

<xsl:template match="db:bibliography" mode="create-bibcollection">
<bibliography>
<modsCollection xmlns="http://www.loc.gov/mods/v3">
<xsl:for-each select="distinct-values(key('citekey', 'all'))">
<!--+ ================================================
| bibrecord variable identifies where to locate the bib records; in
| this case, we access them via http from an eXist XML DB
+-->
<xsl:variable name="bibrecord"
select='doc(concat("http://localhost:8080/exist/servlet/db/mods? _query=", "/mods:modsCollection/mods:mods[@ID='", ., "']"))'/>
<xsl:copy-of select="$bibrecord" />
</xsl:for-each>
</modsCollection>
</bibliography>
</xsl:template>


However, when I run it from Saxon, I get this error:

Error reported by XML parser: Whitespace required before attributes.

So, I decided to try to access a document via a web browser. I got an error until I added the namespace declaration in the query. So, this works from the browser:

http://localhost:8080/exist/servlet/db/biblio? _query=declare%20namespace%20mods=%22http://www.loc.gov/mods/v3%22;/ mods:modsCollection/mods:mods[@ID='Tilly2000a']

.... but this does not from Saxon:

<xsl:variable name="bibrecord"
select='doc(concat("http://localhost:8080/exist/servlet/db/biblio? _query=declare%20namespace%20mods=%22http://www.loc.gov/mods/v3%22;", "/mods:modsCollection/mods:mods[@ID='", ., "']"))'/>


I know in theory it should work, since I got the suggestion from the author of eXist; am just not sure where the problem is. Is there something wrong with my variable select expression (which is what the error is being reported about) from the XSLT/Saxon side?

Bruce

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.