xml - How do I XPath to attribute whose namespace is different to its ancestor's -
i'm trying query codebase attribute on line 11 of xml file.
<?xml version="1.0" encoding="utf-8"?> <asmv1:assembly xsi:schemalocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestversion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-rel-r-ns" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2"> <assemblyidentity name="vcilapp.application" version="0.0.0.0" publickeytoken="0000000000000000" language="neutral" processorarchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" /> <description asmv2:publisher="vcil" asmv2:product="vcilapp" xmlns="urn:schemas-microsoft-com:asm.v1" /> <deployment install="true" minimumrequiredversion="0.0.0.0" co.v1:createdesktopshortcut="true"> <subscription> <update> <beforeapplicationstartup /> </update> </subscription> <deploymentprovider codebase="file://vandc/vcfileshare/vc apps/dialler/vcilapp.application" /> </deployment> <compatibleframeworks xmlns="urn:schemas-microsoft-com:clickonce.v2"> <framework targetversion="4.5" profile="full" supportedruntime="4.0.30319" /> </compatibleframeworks> <dependency> <dependentassembly dependencytype="install" codebase="application files\vcilapp_3_0_9_2705\vcilapp.exe.manifest" size="26738"> <assemblyidentity name="vcilapp.exe" version="0.0.0.0" publickeytoken="0000000000000000" language="neutral" processorarchitecture="msil" type="win32" /> <hash> <dsig:transforms> <dsig:transform algorithm="urn:schemas-microsoft-com:hashtransforms.identity" /> </dsig:transforms> <dsig:digestmethod algorithm="http://www.w3.org/2000/09/xmldsig#sha256" /> <dsig:digestvalue>7ikkd3ls5fcflulntbyd54jzwk/4l5dnnz4rgbzelb8=</dsig:digestvalue> </hash> </dependentassembly> </dependency> </asmv1:assembly>
it need along lines of /assembly/deployment/deploymentprovider/@codebase namespace prefixes need accounted for. deployment element possibly causing problem it's not in asmv1 namespace ancestors.
can provide xpath codebase attribute?
you didn't give details of in context use xpath expression, generally:
- map
asmv1
urn:schemas-microsoft-com:asm.v1
- map
asmv2
urn:schemas-microsoft-com:asm.v2
then expression want:
/asmv1:assembly/asmv2:deployment/asmv2:deploymentprovider/@codebase
Comments
Post a Comment