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

Re: xpath query failing

Subject: Re: xpath query failing
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 22 Apr 2016 19:27:41 -0000
Re:  xpath query failing
I'm afraid this is the number 1 xpath gotcha. Your nlog element is in a
namespace and you are searching for nlog elements in no namespace.

The framework in which you are executing the XPath expression should give you
some means of binding a prefix to the namespace, for example

setNamespaceBinding("n", "http://www.nlog-project.org/schemas/NLog.xsd")

You can then use the path expression "/n:nlog/@throwExceptions"

Michael Kay
Saxonica


> On 22 Apr 2016, at 20:21, Joseph L. Casale jcasale@xxxxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> I am trying to chase down an issue with the Microsoft WIX msi
> installation framework. I have some xml such as:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>      throwExceptions="true">
>    <!-- ... -->
> </nlog>
>
> The selector I am using is "/nlog/@throwExceptions" which is failing and
> it appears to be as a result of the default namespace specifier for
> "http://www.nlog-project.org/schemas/NLog.xsd".
>
> I am not clear on how this invalid, but it looks to be more of a
restriction
> on the parser? Am I overlooking an issue with the actual xml format is
> it related just the parser?
>
> Thanks,
> jlc

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.