All Questions
Tagged with namespaces xpath
227 questions
0
votes
2
answers
69
views
Find XML node in d:-namespace in Java using XPath
I have an XML file of which I want to address a certain element in Java using an XPath. The problem is that the element is in the d:-namespace, and everything I have tried to add the namespace to the ...
0
votes
1
answer
19
views
xpath expression for 2 or more namespases java
I need all namespaces of xml document.
<out1:case<br />
xmlns:out="http://ns1"<br />
xmlns:out1="http://ns2" schemaVersion="1.0"><br />
</...
1
vote
1
answer
31
views
Xpath cannot check passing attribute using namespace
Using this xpath exercise code:
<datasource formatted-name='Activity' inline='true' source-platform='win' version='18.1' xmlns:user='http://www.tableausoftware.com/xml/user'>
<column ...
1
vote
0
answers
13
views
Using XPath when XML has multiple namespaces, no default namespace [duplicate]
I have been working with XML files with default namespaces. Thanks to the contributors to StackOverflow, I have been able to parse them with
# Python
xmlns = docroot.namespaceURI
xmldoc.SetProperty(&...
0
votes
1
answer
369
views
Namespace resolver supporting default namespace in xml to evaluate xpath
My XML document starts like :
<?xml version='1.0' encoding='UTF-8'?>
<article xmlns:d="http://docbook.org/ns/docbook"
xmlns="http://docbook.org/ns/docbook"
...
1
vote
1
answer
41
views
How can i select the namespace definition tag with an xpath
I have the below example:
<?xml version="1.0" encoding="UTF-8"?>
<my:root xmlns:my="http://www.example.com/mynamespace">
<my:child name="Sid">
...
0
votes
1
answer
54
views
Using PHP and XPATH to render XML nodes embedded within an XML node
I'm trying to parse an XML document with namespaces with PHP to output HTML, retaining its original structure.
I have used XPATH and foreach loops in my code below to render headings, paragraphs and ...
1
vote
2
answers
222
views
How can I generate a namespace for a KML file in Javascript XPath
I want to preface this by saying that I understand there are a lot of similar questions out there (on stack and other sites) related to this problem, but I have spent the past few hours scouring every ...
0
votes
1
answer
209
views
How to combine None and "g" namespace?
I'm parsing Google products XML file that has "g" and also empty namespace.
<feed ...
<entry>
<g:id>2</g:id>
<title>Some product
Trying to use ...
1
vote
1
answer
351
views
Lxml and python : iterate only over existing elements
I have a KML file which contains 2 placemarks :
Test1 and Test2.
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<Placemark>
<name>Test1</name>
...
0
votes
3
answers
359
views
how to declare wildcard in namespaces in soapui?
I have two environments. Local and cloud. in cloud i get result with namespace as
<ServiceAvailability **xmlns="http://types.infrastructure.abc.de"**>
<BackendSystem>*</...
1
vote
0
answers
8
views
XPATH: How can I reference the child node when the default namespace has been overridden (without using wildcards) [duplicate]
I'm trying to come up with an XPath expression for the COL node in the following XML document:
<?xml version="1.0" encoding="US-ASCII"?>
<RESP
xmlns="urn:brown....
1
vote
0
answers
14
views
How to read tag values from XML that has a namespace set? (How to work around the namespace) (Java) [duplicate]
I have an input XML provided through a String (it is an ISO20022 payment message) and I'd like to extract values for certain tags from that XML.
Here is my source code:
package com.company;
import ...
0
votes
1
answer
388
views
Accessing the attributes from a response XML with namespaces in node.js
I have an XML response from an API call and would like to know the best and hopefully simplest way to get the attribute values like serv:result and use:sessionTicket or any other leaf element in node....
1
vote
2
answers
2k
views
How to patch an xml file with namespaces using xml-patch and xpath?
I am trying to patch several XML files using XML-patch, more specifically using this library https://github.com/dnault/xml-patch
I can properly patch any xml file that does not contain any namespace ...
0
votes
1
answer
40
views
Xpath is not giving result scrapy python
I am using xpath to retrieve a PDF link
response.xpath('//a[@id="jr-pdf-sw"]/@href')
link where I am using this xpath -> https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7064742/
My response looks ...
0
votes
2
answers
102
views
Using Scrapy Python not able to extract data from response html with xpath due to namespace
I am using scrapy with xpath to extract data from a webpage. My html response looks like this,
I want to extract the href link present in the highlighted "a" tag.
Usually I use response.xpath('//a[@...
3
votes
1
answer
818
views
PostgresSQL xpath with namespaces
I would like to know how to use the xpath funtion in the following example:
The xml is inside a table called SR_DATA, field XMLDATA of type TEXT
The following is the structure of the xml document:
&...
0
votes
0
answers
76
views
Outgoing XML document has two xmlns attributes with different values after map
A the title says, my XML document ends up with two xmlns attributes on the root node after executing my map, and is thus invalid according to XML syntax.
I am unsure what causes this behavior. The ...
0
votes
1
answer
125
views
Creating XmlNode with specified spread sheet type
I'm little bit new in xml manipulation. I want to create a XmlNode.
I've already tried to OwnerDocument.CreateElement method and also tried OwnerDocument.CreateNode method, but I can't create the ...
0
votes
1
answer
350
views
C# Load DataTable from LinQ XDocument
I have a complex XML which is loaded into XDocument and I want to turn it into a DataTable please. Here is the actual XML:
<?xml version="1.0"?>
<XMLCONTAINER version="1.0" incCount="3">
&...
2
votes
1
answer
7k
views
PowerShell XML select node with namespace
I am trying to select nodes from an XML file but am encountering issue that appear to be caused by the namespace.
The code below does not return anything. But if I remove the namespace from the XML ...
0
votes
1
answer
379
views
Xpath for scrapy with atom namespace
I am trying to scrape data from an xml file using scrapy.
The file is structures as follows:
<feed xml:base="https://example.com/sap/...">
<entry><id>http://example.com/.../idset&...
2
votes
2
answers
1k
views
Remove nokogiri attribute based on namespace prefix
I'm using nokogiri to parse an XML file. Some of the nodes in the file have attributes specific to namespaces:
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/...
0
votes
1
answer
1k
views
How to extract element value from an xml containing namespaces with xPath in Java?
Environment: Windows 10, Eclipse, Java 1.5
Objective:
I'm trying to obtain the element text value of an xml using xPath. The xml contains various namespaces.
Problem: I always get an empty value.
I ...
0
votes
1
answer
199
views
"The prefix 'vat' in XPath cannot be resolved" when validating XML schema instance
I am getting the above error when trying to validate an XML document on a schema. Below is a sample from my schema. The prefix 'vat' is used on the FileReference element, but from what I can see, it ...
0
votes
2
answers
256
views
Not Referencing Default Namespace in XSLT [duplicate]
I'm having trouble with the default namespace in the xml file I'm trying to reference. Does anyone know whey this default ns is causing me so much grief. I'm at my wits end!
InputXML
<?xml ...
0
votes
0
answers
48
views
XSL mapping ignoring empty namespace
With reference to the post for mapping elements ignoring namespaces: How to ignore namespace when selecting XML nodes with XPath
Solutions:
//*[local-name()='name']
//*:name
Have the following ...
1
vote
1
answer
122
views
How to make namespaces work with XPaths out of the box?
The online XPath tester works similar to my code below for the given XML and XPath (doesn't match anything): http://www.xpathtester.com/xpath
import java.io.*;
import javax.xml.parsers....
0
votes
2
answers
385
views
Reading child nodes with multiple namespaces
There are many many posts about namespaces and reading XML nodes but I have been unable to find an answer to my specific query. I believe my approach is correct but I am obviously missing something ...
3
votes
2
answers
6k
views
How to iterate through all element in XML in Select Nodes
I am really new at c#. I am creating a project where I need to extract data from a XML file. I can select one single node and loop through the innertext of that element. But I have several elemt in ...
0
votes
0
answers
2k
views
Xpath compilation for Child element with namespace + Getting error - Prefix must resolve to a namespace: ns2
Sample
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<ns2:bookStore xmlns:ns2="http://bookstore.com/schemes">
<ns2:book id="1">
<ns2:name>Data Structure</...
2
votes
1
answer
745
views
XPATH Using Namespace Property and SelectSingleNode Attribute
I've got this XML - it's an Excel Ribbon's _rels file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/...
2
votes
2
answers
539
views
Does XPath have a defined way to retrieve the URI of a namespace from its abbreviation when the URI is not known?
I am trying to write an XPath query to extract the URI of a specific namespace that will always use the same abbrevation.
Example:
<RequestPacket xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
1
vote
2
answers
338
views
Why won't my xpath work?
I have the following xml:
<?xml version="1.0" encoding="UTF-8"?>
<prefix:someName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:prefix="someUri" xsi:schemaLocation="...
1
vote
1
answer
69
views
Manipulate XMLNamespaces
I have the following output from SQL using FOR XML clause:
<q17:DestinationSection xmlns:q17="http://ITrack.Transmission/2011/02/25/Objects">
<q17:DestinationCode>1</q17:...
0
votes
1
answer
296
views
How to not display XMLNAMESPACES alias
I understand the main purpose of XMLNAMESPACES clause is to declare the namespace and use it further.
I have the following code
DECLARE @XMLFINAL VARCHAR(MAX)
SET @XMLFINAL=''
DECLARE @NUMBER ...
0
votes
2
answers
73
views
Products and Product namespace breaks my xpath
I'm trying to find some data in a xml sheet.
I could get the data from the xml if the namespaces where removed like this:
$nodes = $data->xpath('//Products/Product/productId[.='.$sku.']/...
0
votes
0
answers
49
views
XPath and Namespace
I have the following soap response and want to extract the list of products:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"...
3
votes
0
answers
286
views
Which namespace for Math functions in SPARQL?
I'm currently developing a project in which I use AllegroGraph as graph database. AllegroGraph provides full support for SPARQL 1.1 Query and Update.
I'm trying to write a SPARQL query in which I need ...
2
votes
2
answers
1k
views
T-SQL: Adding namespaces to XML
I am creating T-SQL code to retrieve information in XML form.
The below shows the current output from the T-SQL code:
<ReportingGroup>
<AccountReport>
<AccountNumber>...
1
vote
1
answer
310
views
XQuery: omit namespaces for source documents containing no namespaces
I want to use XQuery in order to map between two XML documents. Whereas the source document does not contain any namespace declaration, the target document requires a target namespace (must be the ...
0
votes
0
answers
424
views
XPath Java evaluate expression with double slash against document with namespace specified
Here is some Java-Code:
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers....
0
votes
1
answer
214
views
Error in adding multiple namespace to the output XML
I am trying to generate an XML output from the given input XML using XSLT. The output xml will have different namespaces added to it at various level of the xml tree. I am using XPath axes (descendant)...
0
votes
1
answer
986
views
Find the occurrence of specific Node in xml in XMLType column with xpath and having different namespace prefix for root and chaild node tag
I have to find existence of specific node in XML which is present in an Oracle database column (CLOB datatype) in select query.
I thought of using the Oracle function EXISTSNODE to get expected ...
1
vote
0
answers
125
views
Get deal with node that have NO namespace
Recently, we have trouble with some unusual XML.
Suppose, XML looks like
<rootNode>
<childNode xmlns = "http://default.namespace.com">
<targetNode>
...
1
vote
2
answers
386
views
using no namespace in xpath expression
In an XSLT stylesheet, I have set xpath-default-namespace to match the input document that the stylesheet processes. The output document is in the no namespace.
For example, the xsl:stylesheet ...
2
votes
3
answers
1k
views
Delete namespace from xmlstarlet output
Background
Looking to extract elements from the following XML content:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
...
0
votes
1
answer
4k
views
Oracle UpdateXML not accepting a valid xPath
I have an XML in XMLTYPE column, that looks like the following:
<n:ROOT xmlns:app="http://company/acms/content/DocType" xmlns:n="http://company/acms/content/DocType">
<Content>
&...
3
votes
2
answers
3k
views
C# Read XML with multiple variable namespaces
I have to read some tags and attributes from an XML that has a defined structure but since those files can be generated from different sources, they can have different namespaces and prefixes.
This ...