Re: probleme with xml et &#10 suite conversion xsl (niveauÝE9butant)

Eric van der Vlist <[email protected]>
Newsgroups gmane.text.xml.french.tech
Organization Dyomedea (http://dyomedea.com)
Message-ID <[email protected]>
Bonjour,
Le vendredi 01 septembre 2006 à 15:39 +0000, Stéphane ANCELOT a écrit :
> Bonjour,
> Apres avoir transforme un fichier xml via xsl , je recupere des codes 
> &#10 dans mes valeurs comment faire pour éviter ca?
> 
> voici le resultat :
>   points="&#10;1,2,3,4&#10;">
> 
> etrange non ?

Non :-) ... "&#10;" est la manière de coder des retours à la ligne dans
un attribut... 

> voici le code xsl utilisé et les data xml
> 
> DATA XML :
> <coord>
> 1,2,3,4
> </coord>
> 
> XSL:
> 
> 	<xsl:attribute name="points">
> 	<xsl:value-of   select="coord"/>
> 	</xsl:attribute>

Le plus simple pour enlever ces caractères est d'utiliser la fonction
normalize-space : <xsl:value-of   select="normalize-space(coord)"/>.

A noter également que vous pouvez éviter l'instruction xsl:attibute en
utilisant des {} :

<coord points="{normalize-space(coord}"/>

cf http://xmlfr.org/documentations/faq/010103-0002

Cordialement,

Eric van der Vlist

-- 
GPG-PGP: 2A528005
Le premier annuaire des apiculteurs 100% XML!
                                                http://apiculteurs.info/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------


-- Attached file included as plaintext by Ecartis --

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBE+DluDvn+ZCpSgAURAiqQAJwIN+ivogcz8djxPZo7zQIkUQp7WACfcAKg
2r0ug4zJDHFKoikFimtzgb8=
=4z/+
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.