Indeed, "/book" should not match if your document is in the DocBook 5 namespace. Perhaps a short sample document and short customization layer would provide us with more information to sort this out.

Bob Stayton
Sagehill Enterprises
[EMAIL PROTECTED]


----- Original Message ----- From: "Geraint North" <[EMAIL PROTECTED]>
To: "Thomas Schraitle" <[EMAIL PROTECTED]>
Cc: "Bob Stayton" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Friday, December 14, 2007 6:54 AM
Subject: Re: [docbook-apps] Something like an attribute-set, but different


Hi Tom,

On 14 Dec 2007, at 12:56, Thomas Schraitle wrote:
Hi,

I'm having difficulty getting the desired effect, though (either with
params or attribute sets), which I think is due to my
misunderstanding of Xpath query syntax.  I've constructed a very
small case that illustrates my misunderstanding.

Within an attribute-set, the following evaluates as true

   <xsl:when test="/book">

But the following does not:

   <xsl:when test="/book/info[1]">
nor does
   <xsl:when test="/book/info">

The info element looks like you are using DocBook 5, right?
In this case the above test is expected to fail, because the
element belongs to no namespace. You need the DocBook5 namespace
for each element. Insert the following line in <xsl:stylesheet>:

  xmlns:d="http://docbook.org/ns/docbook";

You have to change the XPath expression a bit to take care of the
DocBook5 namespace:

  <xsl:when test="/d:book/d:info[1]">


Thanks for taking the time to answer, but I'm afraid that I'd tried adding namespaces and that didn't work. Once I've added the correct namespace declaration, the following test won't match:

<xsl:when test="/d:book">

Let alone anything more complicated. Making the docbook namespace the default namespace doesn't help either.

I'm a bit confused that "/book" _does_ match - if it were a namespace issue, then I wouldn't expect that to be matching either?

Thanks,

Geraint North
Principal Engineer
Transitive
* The leader in cross-platform virtualization

This E-mail and any attachments hereto are strictly confidential and intended solely for the addressee. If you are not the intended addressee please notify the sender by return and delete the message. You must not disclose, forward or copy this E-mail or attachments to any third party without the prior consent of the sender.







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to