libxml xpath를 사용할 때 네임스페이스 문제 때문에 질문올립니다~~

ahn7777의 이미지

밑에는 wsdl 문서의 예구요.
xpath를 이용하여 노드들을 가져와야 하는데 네임스페이스를 반드시 등록을 해야만
값을 얻을 수 있더라고요.

그렇다면 definitions 에 명시된 모든 네임스페이스들을 등록해줘야하는 건가요?
wsdl 문서는 정해져 있는것이 아니고 바뀌는 부분이기 때문에 어떻게 해주어야 하는건지
난감하네요.

처음 wsdl 문서를 읽고나서 definitions 부분의 네임스페이스들을 파싱하는 작업이 필요한건지 알고싶습니다.
아니면 모든 네임스페이스를 지우는 방법이 있는건지도 궁금하네요..ㅜㅠ

<?xml version="1.0" encoding="UTF-8"?>

< definitions name="calc"
targetNamespace="http://websrv.cs.fsu.edu/~engelen/calc.wsdl"
xmlns:tns="http://websrv.cs.fsu.edu/~engelen/calc.wsdl"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:calc"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">

< types>

< schema targetNamespace="urn:calc"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:calc"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
< import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>

< message name="addRequest">
< part name="a" type="xsd:double"/>
< part name="b" type="xsd:double"/>

< message name="addResponse">
< part name="result" type="xsd:double"/>

< message name="subRequest">
< part name="a" type="xsd:double"/>
< part name="b" type="xsd:double"/>

< message name="subResponse">
< part name="result" type="xsd:double"/>

< message name="mulRequest">
< part name="a" type="xsd:double"/>
< part name="b" type="xsd:double"/>

< message name="mulResponse">
< part name="result" type="xsd:double"/>

< message name="divRequest">
< part name="a" type="xsd:double"/>
< part name="b" type="xsd:double"/>

< message name="divResponse">
< part name="result" type="xsd:double"/>

< message name="powRequest">
< part name="a" type="xsd:double"/>
< part name="b" type="xsd:double"/>

< message name="powResponse">
< part name="result" type="xsd:double"/>

< portType name="calcPortType">
< operation name="add">
< documentation>Sums two values
< input message="tns:addRequest"/>
< output message="tns:addResponse"/>

< operation name="sub">
< documentation>Subtracts two values
< input message="tns:subRequest"/>
< output message="tns:subResponse"/>

< operation name="mul">
< documentation>Multiplies two values
< input message="tns:mulRequest"/>
< output message="tns:mulResponse"/>

< operation name="div">
< documentation>Divides two values
< input message="tns:divRequest"/>
< output message="tns:divResponse"/>

< operation name="pow">
< documentation>Raises a to b
< input message="tns:powRequest"/>
< output message="tns:powResponse"/>

< binding name="calc" type="tns:calcPortType">
< SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
< operation name="add">
< SOAP:operation style="rpc" soapAction=""/>
< input>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

< output>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>


< operation name="sub">
< SOAP:operation style="rpc" soapAction=""/>
< input>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

< output>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>


< operation name="mul">
< SOAP:operation style="rpc" soapAction=""/>
< input>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

< output>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>


< operation name="div">
< SOAP:operation style="rpc" soapAction=""/>
< input>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

< output>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>


< operation name="pow">
< SOAP:operation style="rpc" soapAction=""/>
< input>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

< output>
< SOAP:body use="encoded" namespace="urn:calc" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>


< service name="calc">
< documentation>Simple calculator service
< port name="calc" binding="tns:calc">
< SOAP:address location="http://websrv.cs.fsu.edu/~engelen/calcserver.cgi"/>

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.