Hi all,

In HXT, namespace prefixes bound by an XML document are valid in the
context of an XPath. How do avoid that?

An example program will clarify:

simpleXml :: String
simpleXml = "<soap:Body 
xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\"/>"

nsEnv :: [(String, String)]
nsEnv = [ ("s"    , "http://www.w3.org/2003/05/soap-envelope";) ]

evalXPath :: String -> String -> [XmlTree]
evalXPath xpath xml =
  runLA ( xread
          >>> propagateNamespaces
          >>> getXPathTreesWithNsEnv nsEnv xpath
        ) xml

Here:

evalXPath "//s:Body" simpleXml     ==
evalXPath "//soap:Body" simpleXml

Even though I only mentions the prefix "s" (and not "soap") in the
function nsEnv.

I do not want the XPath to see prefixes declared in the xml-document, as
it means that two semantically similar XML documents can get different
results when applied to the same XPath.

Also, is there any way to get 'getXPathTreesWithNsEnv' to recognize
XPath namespace declarations? I am thinking about declarations like:

declare namespace foobar='http://foobar.org/foobar'


Greetings,

Mads Lindstrøm

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to