Questions about the XML::Entities Perl module.
Questions tagged [xml-entities]
55 questions
                    
                    6
                    
            votes
                
                2 answers
            
        How to decode XHTML and/or HTML5 entities in Java?
I have some strings that contain XHTML character entities:
"They're quite varied"
"Sometimes the string ∈ XML standard, sometimes ∈ HTML4 standard"
"Therefore -> I need an XHTML entity decoder."
"Sadly, some strings are not valid…
         
    
    
        Karol S
        
- 9,028
- 2
- 32
- 45
                    5
                    
            votes
                
                2 answers
            
        How to resolve external entities with xml.etree like lxml.etree
I have a script that parses XML using lxml.etree:
from lxml import etree
parser = etree.XMLParser(load_dtd=True, resolve_entities=True)
tree = etree.parse('main.xml', parser=parser)
I need load_dtd=True and resolve_entities=True be have…
         
    
    
        towi
        
- 21,587
- 28
- 106
- 187
                    4
                    
            votes
                
                2 answers
            
        Converting escaped XML entities back into UTF-8
So I've got this UTF-8 string in an XML file:
Horrible place. ☠☠☠
And when I feed it to an external application, the funny characters come back escaped as XML entities:
Horrible place. ☠☠☠
In Ruby, how do I convert that string…
         
    
    
        lambshaanxy
        
- 22,552
- 10
- 68
- 92
                    4
                    
            votes
                
                3 answers
            
        How can I add entity declarations via XML::Twig programmatically?
For the life of me I cannot understand the XML::Twig documentation for entity handling.
I've got some XML I'm generating with HTML::Tidy.  The call is as follows:
my $tidy = HTML::Tidy->new({
    'indent'          => 1,
    'break-before-br' => 1,
 …
         
    
    
        Sir Robert
        
- 4,686
- 7
- 41
- 57
                    4
                    
            votes
                
                1 answer
            
        Using text() to match custom entity names in XSLT
I am using  to match text in my XML Document, which is working fine for plain text and known entities, i.e. it works fine for entities like & or unicode entities like π.
However what's not working is… 
         
    
    
        ksbg
        
- 3,214
- 1
- 22
- 35
                    3
                    
            votes
                
                1 answer
            
        Perl XML-SAX-Expat external entity location
I am using XML-Simple along with XML-SAX-Expat to parse a document with external entities. I declare my entity like:
And I refer to from another file in the same directory. 
However, it is searching my current…
         
    
    
        brianegge
        
- 29,240
- 13
- 74
- 99
                    3
                    
            votes
                
                3 answers
            
        Unescape numeric XML Entities with Lua
What's a good implementation for unescaping numeric HTML/XML entities, e.g. 
 and replacing them with the ASCII equivalent?
Expressed as a unit test:
local orig = "It's the "end" &ok;
"
local fixd = unescape(orig) -- Implement…
         
    
    
        Phrogz
        
- 296,393
- 112
- 651
- 745
                    2
                    
            votes
                
                1 answer
            
        XML character entities not parsing
I'm working with a server.xml file...
Case 1:
 
    
    
                
            
        
    
 
    
    
        Dark Matter
        
- 300
- 2
- 15
                    2
                    
            votes
                
                2 answers
            
        Load entities in XSLT 2?
I'm using an XSLT 2.0 program to process some MathML documents.  In those MathMLs, there are entities like ⁡ and ⁢, that give me "entity not defined" errors.  Is there a way I can process documents with these entities…
         
    
    
        MetroWind
        
- 541
- 4
- 16
                    2
                    
            votes
                
                1 answer
            
        XXE and BILLION LAUGHS
whether xxe and billion laughs is possible using xmlpullfactory?I have tried below xml code
]>
&js; 
parsed above xml…
         
    
    
        user3748225
        
- 41
- 3
                    2
                    
            votes
                
                1 answer
            
        Javascript DOMParser and XMLSerialier removes XML entities
I am trying to preserve some XML entities when parsing XML files in javascript.  The following code snippet illustrates the problem.  Is there a way for me to make round-trip parse and retain the XML entities (  is nbsp; html)?  This happens in…
         
    
    
        Aaron Newman
        
- 549
- 1
- 5
- 27
                    2
                    
            votes
                
                2 answers
            
        PHP SimpleXMLElement not making quotes into entities
I'm writing a PHP script to generate some xml docs and I am having some issues with SimpleXML and quotes.
If I have code like this:
$xml = new SimpleXMLElement('
         
    
    
        user970053
        
- 21
- 2
                    2
                    
            votes
                
                1 answer
            
        SimpleXML with decoded entities
How can I make SimpleXML to replace HTML/XML entities with their respective characters, in PHP?
Assume having this XML document, in a string:
$data = 'Tom & Jerry '
Obviously, I want…
         
    
    
        Pavel S.
        
- 11,892
- 18
- 75
- 113
                    2
                    
            votes
                
                1 answer
            
        xhtml adding entities
I have an Website which is delivered with as xhtml (with header an doctype). I get data from the server which sometimes contains some   entities what leads to an error when I try to set a string containing this via innerHTML. How I have already…
         
    
    
        philipp
        
- 15,947
- 15
- 61
- 106
                    2
                    
            votes
                
                2 answers
            
        Only convert <, >, &, ' and " for XML?
It seems I have another problem with special character and double quotes and so on after this question that has been solved earlier.
I used to use this function that convert symbol like '&' to numberic code for XML,
function…
         
    
    
        Run
        
- 54,938
- 169
- 450
- 748