You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Raul <rp...@renr.es> on 2015/02/03 16:41:07 UTC
DIH: entities in xml problem
Hi all!
I'm trying to use Solr with the DIH and xslt processing. All is fine
till i put xml with html entity in the content (like $euro;) where i get a
Caused by: javax.xml.transform.TransformerException:
com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
i put in the xsl the dtd declaration of the entity but i don't get lucky:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE stylesheet [
<!ENTITY laquo "«">
<!ENTITY raquo "»">
<!ENTITY hellip "…">
<!ENTITY euro "€">
]>
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
....
Do you know how i can proccess??
Thanks in advance
DIH: entities in xml problem
Posted by Raul <rp...@renr.es>.
Hi all!
I'm trying to use Solr with the DIH and xslt processing. All is fine
till i put xml with html entity in the content (like $euro;) where i get a
Caused by: javax.xml.transform.TransformerException:
com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
i put in the xsl the dtd declaration of the entity but i don't get lucky:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE stylesheet [
<!ENTITY laquo "«">
<!ENTITY raquo "»">
<!ENTITY hellip "…">
<!ENTITY euro "€">
]>
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
....
Do you know how i can proccess??
Thanks in advance
Re: DIH: entities in xml problem
Posted by Raul <rp...@renr.es>.
Thanks for the reply.
I'm going tol try with a custom transform to see if process the file
before the xml parser. And I will see the regex for determine if it is
appropriate for this.
Regards
El 04/02/15 a las 13:37, Michael Sokolov escribió:
> Yes, you could do some kind of regex preprocess; you can't feed named
> entities to an XML parser without providing a DTD, sadly. But that
> probably isn't any easier than adding the DTD -- both require updating
> every file. Another possibility is writing some custom code that does
> the modification inline while streaming the docs into DIH, but I don't
> know enough about DIH to know how easy/hard that would be ..
>
> -Mike
>
> On 2/4/15 2:37 AM, Raul wrote:
>> How would you do the transform of the content to convert the
>> entities? With a pre-proccess? We have lot of xml with the content
>> insert (and the content has the entities) and will be dificult add
>> the DTD to the content...
>>
>> Thanks
>>
>> - Raul
>> El 03/02/15 a las 17:15, Michael Sokolov escribió:
>>> If the entities are in the content, you would need to add the DTD to
>>> the content, not to the stylesheet. Or you could transform the
>>> content converting the entities.
>>>
>>> -Mike
>>>
>>> On 02/03/2015 10:41 AM, Raul wrote:
>>>> Hi all!
>>>>
>>>> I'm trying to use Solr with the DIH and xslt processing. All is
>>>> fine till i put xml with html entity in the content (like $euro;)
>>>> where i get a
>>>>
>>>> Caused by: javax.xml.transform.TransformerException:
>>>> com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
>>>>
>>>>
>>>> i put in the xsl the dtd declaration of the entity but i don't get
>>>> lucky:
>>>>
>>>> <?xml version='1.0' encoding='UTF-8'?>
>>>>
>>>> <!DOCTYPE stylesheet [
>>>>
>>>> <!ENTITY laquo "«">
>>>> <!ENTITY raquo "»">
>>>> <!ENTITY hellip "…">
>>>> <!ENTITY euro "€">
>>>>
>>>> ]>
>>>> <xsl:stylesheet version='1.0'
>>>> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
>>>> ....
>>>>
>>>> Do you know how i can proccess??
>>>>
>>>> Thanks in advance
>>>
>>>
>>
>>
>
>
--
Raúl Pampliega Mayoral
Proyecto Ediciones Digitales
e-mail: rpampliega@renr.es
Recursos en la Red, S.L.U.
Editorial Prensa Ibérica
La Información incluida en este email es CONFIDENCIAL, siendo para uso exclusivo del destinatario arriba mencionado. Si Ud lee este mensaje y no es el destinatario indicado, le informamos que está totalmente prohibida cualquier utilización, divulgación, distribución y/o reproducción de esta comunicación, total o parcial, sin autorización expresa en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos nos lo notifique inmediatamente por esta vía y proceda a su eliminación junto con sus ficheros anexos sin leerlo ni grabarlo.
Re: DIH: entities in xml problem
Posted by Michael Sokolov <ms...@safaribooksonline.com>.
Yes, you could do some kind of regex preprocess; you can't feed named
entities to an XML parser without providing a DTD, sadly. But that
probably isn't any easier than adding the DTD -- both require updating
every file. Another possibility is writing some custom code that does
the modification inline while streaming the docs into DIH, but I don't
know enough about DIH to know how easy/hard that would be ..
-Mike
On 2/4/15 2:37 AM, Raul wrote:
> How would you do the transform of the content to convert the entities?
> With a pre-proccess? We have lot of xml with the content insert (and
> the content has the entities) and will be dificult add the DTD to the
> content...
>
> Thanks
>
> - Raul
> El 03/02/15 a las 17:15, Michael Sokolov escribió:
>> If the entities are in the content, you would need to add the DTD to
>> the content, not to the stylesheet. Or you could transform the
>> content converting the entities.
>>
>> -Mike
>>
>> On 02/03/2015 10:41 AM, Raul wrote:
>>> Hi all!
>>>
>>> I'm trying to use Solr with the DIH and xslt processing. All is fine
>>> till i put xml with html entity in the content (like $euro;) where i
>>> get a
>>>
>>> Caused by: javax.xml.transform.TransformerException:
>>> com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
>>>
>>>
>>> i put in the xsl the dtd declaration of the entity but i don't get
>>> lucky:
>>>
>>> <?xml version='1.0' encoding='UTF-8'?>
>>>
>>> <!DOCTYPE stylesheet [
>>>
>>> <!ENTITY laquo "«">
>>> <!ENTITY raquo "»">
>>> <!ENTITY hellip "…">
>>> <!ENTITY euro "€">
>>>
>>> ]>
>>> <xsl:stylesheet version='1.0'
>>> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
>>> ....
>>>
>>> Do you know how i can proccess??
>>>
>>> Thanks in advance
>>
>>
>
>
Re: DIH: entities in xml problem
Posted by Raul <rp...@renr.es>.
How would you do the transform of the content to convert the entities?
With a pre-proccess? We have lot of xml with the content insert (and the
content has the entities) and will be dificult add the DTD to the content...
Thanks
- Raul
El 03/02/15 a las 17:15, Michael Sokolov escribió:
> If the entities are in the content, you would need to add the DTD to
> the content, not to the stylesheet. Or you could transform the content
> converting the entities.
>
> -Mike
>
> On 02/03/2015 10:41 AM, Raul wrote:
>> Hi all!
>>
>> I'm trying to use Solr with the DIH and xslt processing. All is fine
>> till i put xml with html entity in the content (like $euro;) where i
>> get a
>>
>> Caused by: javax.xml.transform.TransformerException:
>> com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
>>
>>
>> i put in the xsl the dtd declaration of the entity but i don't get
>> lucky:
>>
>> <?xml version='1.0' encoding='UTF-8'?>
>>
>> <!DOCTYPE stylesheet [
>>
>> <!ENTITY laquo "«">
>> <!ENTITY raquo "»">
>> <!ENTITY hellip "…">
>> <!ENTITY euro "€">
>>
>> ]>
>> <xsl:stylesheet version='1.0'
>> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
>> ....
>>
>> Do you know how i can proccess??
>>
>> Thanks in advance
>
>
--
Raúl Pampliega Mayoral
Proyecto Ediciones Digitales
e-mail: rpampliega@renr.es
Recursos en la Red, S.L.U.
Editorial Prensa Ibérica
La Información incluida en este email es CONFIDENCIAL, siendo para uso exclusivo del destinatario arriba mencionado. Si Ud lee este mensaje y no es el destinatario indicado, le informamos que está totalmente prohibida cualquier utilización, divulgación, distribución y/o reproducción de esta comunicación, total o parcial, sin autorización expresa en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos nos lo notifique inmediatamente por esta vía y proceda a su eliminación junto con sus ficheros anexos sin leerlo ni grabarlo.
Re: DIH: entities in xml problem
Posted by Michael Sokolov <ms...@safaribooksonline.com>.
If the entities are in the content, you would need to add the DTD to the
content, not to the stylesheet. Or you could transform the content
converting the entities.
-Mike
On 02/03/2015 10:41 AM, Raul wrote:
> Hi all!
>
> I'm trying to use Solr with the DIH and xslt processing. All is fine
> till i put xml with html entity in the content (like $euro;) where i
> get a
>
> Caused by: javax.xml.transform.TransformerException:
> com.sun.org.apache.xml.internal.utils.WrappedRuntimeException
>
>
> i put in the xsl the dtd declaration of the entity but i don't get lucky:
>
> <?xml version='1.0' encoding='UTF-8'?>
>
> <!DOCTYPE stylesheet [
>
> <!ENTITY laquo "«">
> <!ENTITY raquo "»">
> <!ENTITY hellip "…">
> <!ENTITY euro "€">
>
> ]>
> <xsl:stylesheet version='1.0'
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
> ....
>
> Do you know how i can proccess??
>
> Thanks in advance