Questions tagged [xml-encoding]

42 questions
113
votes
6 answers

Meaning of -

I am new to XML and I am trying to understand the basics. I read the line below in "Learning XML", but it is still not clear, for me. Can someone point me to a book or website which explains these basics clearly? From Learning XML: The XML…
XML Boy
  • 1,243
  • 2
  • 9
  • 9
19
votes
3 answers

Xml Escaping/Encoding terminology

I'm confused as for the difference between the terms "escaping" and "encoding" in phrases like: Xml Encoding Xml Escaping Encoded Html Escaped Url ... Can anyone explain it to me?
Yaron Naveh
  • 21,660
  • 31
  • 97
  • 151
8
votes
3 answers

How do I XML-encode a string in Erlang?

I have a erlang string which may contain characters like & " < and so on: 1> Unenc = "string & \"stuff\" <". ok Is there a Erlang function somewhere that parses the string and encodes all the needed HTML/XML entities, such as: 2> Enc =…
ettore
  • 658
  • 10
  • 18
6
votes
1 answer

Web Api XML, How to set Encoding, Version, xmlns:xsi and xsi:schemaLocation

I am using asp.net MVC4 Web Api. I have set: Dim xml = GlobalConfiguration.Configuration.Formatters.XmlFormatter xml.UseXmlSerializer = True I have created a class that specifies the XML I need and this works well. I am almost there but I am not…
Marcel
  • 203
  • 4
  • 12
4
votes
2 answers

Boost read/write XML file: how to change the characters encoding?

I'm trying to read/write an XML file, using Boost functions read_xml and write_xml. The XML file original encoding is "windows-1252", but after the read/write operations, the encoding became "utf-8". This is the XML original file:
Ivano Wellok
  • 39
  • 1
  • 2
3
votes
2 answers

Why does my DataTable not serialize correctly when column names contain spaces?

Normally I try to stay well clear of DataSets and DataTables, but we currently have a requirement where it seems to make sense to use them. I'm having some problems serializing a DataTable when the DataColumn name contains a space and the type of…
JonC
  • 759
  • 7
  • 15
3
votes
2 answers

XML serialization and "<" , ">" when generating an HTML document

I'm trying to dynamically generate an HTML table by using XmlSerializer and a set of classes like this: [XmlInclude(typeof(Th))] public class Td { [XmlElement("span")] public string Designation { get; set; } [XmlAttribute("colspan")] …
anouar.bagari
  • 2,026
  • 18
  • 30
2
votes
2 answers

Apache Camel to handle encoding declared in XML-File

I'm trying to parse an UTF-16 encoded document using Apache Camel Splitter with xtokenize, this delegates to Woodstox (com.ctc.wstx.sr.BasicStreamReader), also I cannot know the encoding of a file before I read it, currently some files are UTF-16,…
antidote
  • 107
  • 10
2
votes
3 answers

When parsing Atom XML feeds, how should conflicting CDATA and entity escaped elements be handled?

How should an Atom feed parser handle the following line of XML in a feed: <![CDATA[Johnson & Johnson]]> For the sake of the discussion, lets assume that the originally intended text was in fact Johnson & Johnson. I…
mmcdole
  • 86,293
  • 60
  • 181
  • 221
2
votes
3 answers

how to give encoding as ISO-8859-1 in xml created using LINQ

I have to create an xml file which has encoding as Currently the xml I am creating using LINQ is having tag as how can I do this using LINQ only.
Silver
  • 413
  • 2
  • 10
  • 33
2
votes
1 answer

How do I XmlDocument.Save() to encoding="us-ascii" with numeric character entities instead of question marks?

My goal is to get a binary buffer (MemoryStream.ToArray() would yield byte[] in this case) of XML without losing the Unicode characters. I would expect the XML serializer to use numeric character references to represent anything that would be…
binki
  • 6,057
  • 3
  • 49
  • 84
2
votes
1 answer

"Unexpected token ERROR found" error shown at netbeans working on a jsf project for percent (%) character

I am facing a strange issue with netbeans and jsf, it is not fatal but quite annoying. For some reason I am getting the error "Unexpected character % found Unexpected token ERROR found" from netbeans for the following code block. It is complaining…
cubbuk
  • 7,410
  • 4
  • 29
  • 59
1
vote
1 answer

DOM4J Document: read an ISO-8859-1 xml

I need to read an xml file that is encoded in ISO-8859-1. I'm using: Document document = reader.read(new File(sourceFile)); document.setXMLEncoding("ISO-8859-1"); I'm getting a "cannot find symbol" error for setXMLEncoding. This seems like it…
Duy
  • 87
  • 6
1
vote
2 answers

How to fix a windows-1256 xml parsing error in android?

I have an error when parsing an xml document with sax parser in android. Can someone help me fix this error? The error looks like this: org.apache.harmony.xml.ExpatParser$ParseException: At line 5, column 9: not well-formed (invalid token) The xml…
Ahmed Talaat
  • 621
  • 1
  • 5
  • 14
1
vote
1 answer

Encoder class (org.owasp.esapi.reference.DefaultEncoder) CTOR threw exception

I am trying to run a sample program which encodes using ESAPI. Here is the sample program package hello; import java.io.UnsupportedEncodingException; import org.owasp.esapi.ESAPI; import org.owasp.esapi.Encoder; import…
Adharsh
  • 11
  • 3
1
2 3