If you have correct encoding you dont need to escape Ø
(Ø). Try to use unicode to be sure.
If there is no way to change the behavior try unescaping HTML entities, check PHP manual.
If you have correct encoding you dont need to escape Ø
(Ø). Try to use unicode to be sure.
If there is no way to change the behavior try unescaping HTML entities, check PHP manual.
ok, got a bit further, if I user var_dump instead of echo I get this:
object(SimpleXMLElement)[22]
public 'symbol' =>
object(SimpleXMLElement)[21]
public '@attributes' =>
array
'name' => string 'Oslash' (length=6)
'unicode' => string '00D8' (length=4)
'type' => string 'html' (length=4)
'glyph' => string '@Oslash;' (length=8)
'description' => string 'capital O, slash' (length=16)
'ascii' => string 'O' (length=1)
string ' ' (length=1)
I wonder how I can use that to make a complete string together with the contents of forenames
Looking at the DTD, it says this (but without line breaks):
<!ENTITY Oslash
"<symbol name='Oslash' unicode='00D8'
type='html' glyph='@Oslash;' description='capital O, slash'
ascii='O' > </symbol>"
>
To any XML reader using this DTD, this means "Whenever you see this exact combination of letters in the source: Ø
, replace it with this text: <symbol name='Oslash' unicode... > </symbol>
This means that the XML data actually reads like this:
<forenames>NIELS B<symbol name='Oslash' unicode='00D8'
type='html' glyph='@Oslash;' description='capital O, slash'
ascii='O' > </symbol>IE</forenames>
...which explains why it's not showing up in your browser. The way around it would be to search your XML document for all <symbol>
elements, read the unicode
parameter and replace them with that.
Looking further at it, the comments at the top of the DTD show they've considered people in your situation! The glyph
attribute on the <symbol>
tag is the standard HTML entity to use for that symbol, but with the ampersand replaced with an @.
10 read xml document
20 search for any <symbol> element
30 read the "glyph" attribute
40 remove the <symbol> element
50 replace the @ with an & in glyph
60 write that in the place of <symbol>
70 goto 20