xpath - Querying XML content within an element -


i have odd xml document have query. weather.gov output. information i'd query within under: /enelope/body/ndfdgenresponse/dwmlout. converted form of xml. possible query individual elements under value, or have post process query within it? suspicion i'll have post process.

<?xml version="1.0" encoding="iso-8859-1"?> <soap-env:envelope soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/">     <soap-env:body>         <ns1:ndfdgenresponse xmlns:ns1="http://graphical.weather.gov/xml/dwmlgen/wsdl/ndfdxml.wsdl">             <dwmlout xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;dwml version=&quot;1.0&quot; xmlns:xsd=&quot;http://www.w3.org/2001/xmlschema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/xmlschema-instance&quot; xsi:nonamespaceschemalocation=&quot;http://graphical.weather.gov/xml/dwmlgen/schema/dwml.xsd&quot;&gt;   &lt;head&gt;     &lt;product srsname=&quot;wgs 1984&quot; concise-name=&quot;glance&quot; operational-mode=&quot;official&quot;&gt;       &lt;title&gt;noaa&apos;s national weather service forecast @ glance&lt;/title&gt;       &lt;field&gt;meteorological&lt;/field&gt;       &lt;category&gt;forecast&lt;/category&gt;       &lt;creation-date refresh-frequency=&quot;pt1h&quot;&gt;2012-06-26t19:09:06z&lt;/creation-date&gt;     &lt;/product&gt;     &lt;source&gt;       &lt;more-information&gt;http://graphical.weather.gov/xml/&lt;/more-information&gt;       &lt;production-center&gt;meteorological development laboratory&lt;sub-center&gt;product generation branch&lt;/sub-center&gt;&lt;/production-center&gt;       &lt;disclaimer&gt;http://www.nws.noaa.gov/disclaimer.html&lt;/disclaimer&gt;       &lt;credit&gt;http://www.weather.gov/&lt;/credit&gt;       &lt;credit-logo&gt;http://www.weather.gov/images/xml_logo.gif&lt;/credit-logo&gt;       &lt;feedback&gt;http://www.weather.gov/feedback.php&lt;/feedback&gt;     &lt;/source&gt;   &lt;/head&gt;   &lt;data&gt;     &lt;location&gt; 

..... </conditions-icon> </parameters> </data> </dwml>

with pure xpath not. if invoke xpath other language, can select node first string type variable, parse string xml document , use second xpath expression select nodes inside. it

even if it's possible using pure xpath, two-step approach lot easier code, test , maintain.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -