Including a URL with query string in an XML document

前端 未结 3 2105
清酒与你
清酒与你 2021-02-20 11:41

So I have this XML doc:



    
        http://www.mysite.com/page?id=1

        
相关标签:
3条回答
  • 2021-02-20 11:54

    try this <URL><![CDATA[http://www.mysite.com/page?id=1]]></URL>

    0 讨论(0)
  • 2021-02-20 12:04

    You can try <URL><![CDATA[http://www.example.com/page?id=1]]></URL>

    All text in an XML document will be parsed by the parser. But text inside a CDATA section will be ignored by the parser. You can find more here.

    0 讨论(0)
  • 2021-02-20 12:13

    As you provide it, the XML is well formed. You don't have anything to escape in it. Maybe you have encoding problems in your source file. For information, the 2 characters you must escape in XML are :

    & in &amp;
    < in &lt;
    

    Characters you may escape in attributes values (depending on the syntax you use for attributes : attr='value' or attr="value") :

    " in &quot;
    ' in &apos;
    

    Depending on the context, the last character that can be escaped :

    > in &gt;
    
    0 讨论(0)
提交回复
热议问题