English 中文(简体)
在XML文件中包含一个带有询问的URL。
原标题:Including a URL with query string in an XML document
  • 时间:2011-11-21 16:49:10
  •  标签:
  • xml
  • encoding

因此,我有这个XML做法:

<?xml version="1.0" encoding="UTF-8"?>
<Root>
    <Item>
        <URL>http://www.mysite.com/page?id=1</URL>
    </Item>
</Root>

在我尝试和观看该文件时,我犯了一个错误:

<XML Parsing Error: not well-information

http://www.ohchr.org。 我尝试将<条码>=改为<条码>%3D,但在<条码>上,我有同样的错误。

我应该在这里做些什么?

最佳回答

您可尝试<代码><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.

问题回答

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;

您的属性价值(取决于您对属性的使用:attr=数值attr=“数值”):

" in &quot;
  in &apos;

视具体情况而定,最后的特征是:

> in &gt;





相关问题
Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

Using Java PDFBox library to write Russian PDF

I am using a Java library called PDFBox trying to write text to a PDF. It works perfect for English text, but when i tried to write Russian text inside the PDF the letters appeared so strange. It ...

what is encoding in Ajax?

Generally we are using UTF-8 encoding standard for sending the request for every language. But in some language this encoding standard is not working properly,then in that case we are using ISO-8859-1....

Encoding of window.location.hash

Does window.location.hash contain the encoded or decoded representation of the url part? When I open the same url (http://localhost/something/#%C3%BC where %C3%BCtranslates to ü) in Firefox 3.5 and ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

热门标签