xmlParseEntityRef: no name
Le
unbewusst.sein
j'ai un petit script php qui génère cette erreur :
This page contains the following errors:
error on line 1985 at column 28: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.
la page est présentée au butineur après une transformation xslt.
le fichier xml d'origine est issu d'un fichier texte en Mac Roman, tsv,
transformé en xml par mes soins.
j'ai déjà transformé les "&", "<" et ">" en "&", "&lt;" et
"&gt;" respectivement mais il doit me rester des entités non
référencées d'après ce que me dit le parser.
comme le fichier est long (la page html générée fait 40000 lignes) je
n'ai pas envie de vérifier à la main.
le fichier xml est confidentiel, ce sont mes mots de passe, comptes en
banque etc
y a t'il un outil qui me permettrait de véifier sa validité offline sur
Mac OS X ???
--
« Comment peser sur le bulletin?
Tu t'assieds dessus. »
(Anonyme)
This page contains the following errors:
error on line 1985 at column 28: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.
la page est présentée au butineur après une transformation xslt.
le fichier xml d'origine est issu d'un fichier texte en Mac Roman, tsv,
transformé en xml par mes soins.
j'ai déjà transformé les "&", "<" et ">" en "&", "&lt;" et
"&gt;" respectivement mais il doit me rester des entités non
référencées d'après ce que me dit le parser.
comme le fichier est long (la page html générée fait 40000 lignes) je
n'ai pas envie de vérifier à la main.
le fichier xml est confidentiel, ce sont mes mots de passe, comptes en
banque etc
y a t'il un outil qui me permettrait de véifier sa validité offline sur
Mac OS X ???
--
« Comment peser sur le bulletin?
Tu t'assieds dessus. »
(Anonyme)

Poser une question


Précisions, la ligne indiquée est celle du fichier résultat, donc html,
elle contient :
Copy & paste the above Keycode into the Program. For detailed
instructions, see below: Copy & Paste Instructions: 1. COPY the Keycode
above by highlighting the text then holding the Command key down, hit
the 'C' key. 2. Launch the SereneScreen Marine Aquarium by
double-clicking on the program icon. 3. Press the spacebar to open the
Register dialog box. 4. Hold the Command key down and hit the 'V' key,
this will copy the Keycode into the program. 5. Press the ENTER key to
complete the registration.
le fichier xml lui contient :
Copy & paste the above Keycode into the Program. For detailed
instructions, see below: Copy & Paste Instructions: 1. COPY the
Keycode above by highlighting the text then holding the Command key
down, hit the 'C' key. 2. Launch the SereneScreen Marine Aquarium by
double-clicking on the program icon. 3. Press the spacebar to open the
Register dialog box. 4. Hold the Command key down and hit the 'V' key,
this will copy the Keycode into the program. 5. Press the ENTER key to
complete the registration.
donc ça ne doit pas être le & -> & qui pose problème mais 'C' et 'V'
les ' et ' dont je ne connais pas d'entité, mais je peux changer ça en '
ou " tout court...
--
« Comment peser sur le bulletin?
Tu t'assieds dessus. »
(Anonyme)
bon j'ai changé les "apostrophes arrondies" en ' tout court... même
erreur, même ligne même colonne...
--
« Comment peser sur le bulletin?
Tu t'assieds dessus. »
(Anonyme)
c'est le & résultant qui posait problème aussi ai-je changé ma
transformation :
& -> &amp; (ainsi j'ai & dans le html)
< -> &lt; (comme avant)
curly apostrophe gauche -> '
curly apostrophe droite -> '
et là ça roule...
--
« Comment peser sur le bulletin?
Tu t'assieds dessus. »
(Anonyme)
Mais ...
n'y a t-il pas une chiée de fonctions PHP pour traiter des caractères ?
http://fr.php.net/manual/fr/functio...tities.php
justement pour ne pas avoir à le faire à la main
(ou quasi : preg_replace & cie)
http://fr.php.net/manual/fr/functio...decode.php
http://fr.php.net/manual/fr/functio...lchars.php
http://fr.php.net/manual/fr/functio...-table.php
et aussi : mb_convert_encoding ?
Ha ! ? pas de MacRoman ?
--
Stéphane Moriaux avec/with iMac-intel
Les apostrophes (je suppose qu'il s'agit de U+2018 et U+2019 ??) ne
devraient pas poser problème à priori ?