xsl-list
[Top] [All Lists]

Quoting Quotes in a Stand Along Context

2005-01-25 08:47:08
    I'm writing a utility that matches nodes in a document. For
    testing I'd like to simply print out a XPath statement that maps
    to the node in the document. I'd like to compare that against
    what I expect the output to be.

    I've got an XPath tracker in my SAX ContentHandler. It will
    print something like this:

        /node()[1]/node()[4]/node()[2]

    Which ought to work, but it's hard to read.

    I'd rather emit something like this:

    /element[position() = 1
             and local-name() = 'foo'
             and namespace-uri = 'http://agtrz.com/foo-doc']/text()[3]

    Easier to specify.

    But with no context to set a placeholder, I don't know how to
    escape single quotes in the unlikely event that one occurs in
    the namespace URI.

    How do you escape single quotes in pure XPath?

--
Alan Gutierrez - alan(_at_)engrm(_dot_)com

--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>