xsl-list
[Top] [All Lists]

RE: doc() concat expression and whitespace error

2004-11-15 19:40:27
select='doc(concat("http://localhost:8080/exist/servlet/db/mods? 
_query=", "/mods:modsCollection/mods:mods[(_at_)ID='", ., "']"))'/>

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

        Error reported by XML parser: Whitespace required 
before attributes.

When Saxon prefixes a message with "Error reported by XML parser" it means
that the error is at the XML level rather than the XSLT level - the
stylesheet is not well-formed XML. 

Your attribute starts with {select='} so it ends with the next {'} which is
the one in {(_at_)ID='}, which is not followed by a space. 

If you need to use ' within an attribute delimited by ', you can write it as
', thus:

select='doc(concat("http://localhost:8080/exist/servlet/db/mods?_query=";,
"/mods:modsCollection/mods:mods[(_at_)ID='", ., "']"))'/>

But since the apostrophe is actually a character appearing in a URI, it
might be even better to escape it as %H27. Square brackets in a URI should
also probably be %HH-escaped.

Michael Kay


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--