hy, thanks for the help that made me go further...

Henry Zongaro <[EMAIL PROTECTED]> wrote:
> ['...]
> 
>      The problem is probably due to the declaration of the default 
> namespace (xmlns="vdv454eng") in the second document.  In XPath 1.0, a 
> path expression like /SubscriptionRequest in your stylesheet only selects 
> elements that are no namespace.  In order to select elements that are in a
> 
> namespace (even the default), you must declare a namespace prefix in your 
> stylesheet and use that prefix in path expressions.
> 
>      The template rules in your stylesheet are probably only trying to 
> match names that are in no namespace, and fail to match elements that are 
> in your second document.  Instead, the default template rules are ending 
> up processing your second document.
> 
>      You probably need to decide whether the elements in your document 
> need to be in a particular namespace or no namespace, and use that 
> consistently.  If you believe that you really do need to match elements 
> that have the same local name that might be in no namespace or might be in
> 
> a particular namespace, you have to use expressions like the following:
> 
> <xsl:template match="SubscriptionRequest | pre:SubscriptionRequest"
>               xmlns:pre="vdv454eng">

Ok, i found out that i can set the prefix for the whole stylesheet, so i
don't have to declare that for every matching rule.
Plus i need only pre:SubscriptionRequest if i know that all are in the
"correct namespace.

A last question i have is, if my expression is "wrong" when not explicitly
telling the namespace for every match, even if it is the default - is the xml
that doesn't set the namespace exlicitly is "correct"? 
Or is it just xpath 1.0 that doesn't work as expected because it has no way
to tell that i want to use the default ns vdv454eng and so matching every
item that just follows this same default in an xml document and not setting an
explicit ns for every elemnt?

(if the xml is wrong i'd like to tell the castor people to help them make
their lib better)
Henning

Reply via email to