B
Bill
Hi,
I'm trying to extract the 'types' section out of some WSDL with
xmlstarlet, using the following expression and data:
xmlstarlet sel -t -m '/definitions' -c types short.xml
As listed (without the ###) it produces nothing, but without
the xmlns line it works. Isn't 'xmlns' just disambiguating?
Why should it make such a difference?
Note, that though the below is only partial, the behavior
is the same with the full WSDL file.
Thanks much,
Bill
-- short.xml:
<?xml version="1.0"?>
<!-- the xmlns is what does it -->
<definitions
name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap"
### without the next line it works fine
xmlns="http://schemas.xmlsoap.org/wsdl"
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="TradePriceRequest">
<complexType>
<all>
<element name="tickerSymbol"
type="string"/>
</all>
</complexType>
</element>
<element name="TradePrice">
<complexType>
<all>
<element name="price"
type="float"/>
</all>
</complexType>
</element>
</schema>
</types>
</definitions>
I'm trying to extract the 'types' section out of some WSDL with
xmlstarlet, using the following expression and data:
xmlstarlet sel -t -m '/definitions' -c types short.xml
As listed (without the ###) it produces nothing, but without
the xmlns line it works. Isn't 'xmlns' just disambiguating?
Why should it make such a difference?
Note, that though the below is only partial, the behavior
is the same with the full WSDL file.
Thanks much,
Bill
-- short.xml:
<?xml version="1.0"?>
<!-- the xmlns is what does it -->
<definitions
name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap"
### without the next line it works fine
xmlns="http://schemas.xmlsoap.org/wsdl"
<types>
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="TradePriceRequest">
<complexType>
<all>
<element name="tickerSymbol"
type="string"/>
</all>
</complexType>
</element>
<element name="TradePrice">
<complexType>
<all>
<element name="price"
type="float"/>
</all>
</complexType>
</element>
</schema>
</types>
</definitions>