1

To elaborate on the question, can I replace the namespace definitions with the definition?

Is this still well-formed XML? Are they the "same" in the context of, is the second still a well-formed SOAP XML message, like the original.

For example, This is a well-formed SOAP XML message from an Oracle example. I will then make a copy of it but replace the SOAP-ENV attribute with its definition:

<?xml version="1.0" encoding="utf-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
    <SOAP-ENV:Fault>
        <faultcode>SOAP-ENV:Client</faultcode>
        <faultstring>Message does not have necessary info</faultstring>
        <faultactor>http://gizmos.com/order</faultactor>
        <detail>
        <PO:order xmlns:PO="http://gizmos.com/orders/">
        Quantity element does not have a value</PO:order>
        <PO:confirmation xmlns:PO="http://gizmos.com/confirm">
        Incomplete address: no zip code</PO:confirmation>
        </detail>
    </SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

So SOAP-ENV, which is defined by the quoted definition "http://schemas.xmlsoap.org/soap/envelope/" is replaced.

<?xml version="1.0" encoding="utf-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<http://schemas.xmlsoap.org/soap/envelope/:Header/>
<http://schemas.xmlsoap.org/soap/envelope/:Body>
    <http://schemas.xmlsoap.org/soap/envelope/:Fault>
        <faultcode>SOAP-ENV:Client</faultcode>
        <faultstring>Message does not have necessary info</faultstring>
        <faultactor>http://gizmos.com/order</faultactor>
        <detail>
        <PO:order xmlns:PO="http://gizmos.com/orders/">
        Quantity element does not have a value</PO:order>
        <PO:confirmation xmlns:PO="http://gizmos.com/confirm">
        Incomplete address: no zip code</PO:confirmation>
        </detail>
    </http://schemas.xmlsoap.org/soap/envelope/:Fault>
</http://schemas.xmlsoap.org/soap/envelope/:Body>
</http://schemas.xmlsoap.org/soap/envelope/:Envelope>

1 Answer 1

2

No, the syntax you've suggested for replacing namespace prefixes with namespace URIs is not well-formed XML. Some software supports something close, though:

<{http://schemas.xmlsoap.org/soap/envelope/}Envelope />

This is commonly referred to as Clark Notation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.