XML modified by domToString

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

XML modified by domToString

Claudio Delgado
All,


I have a document that pass through the page flow and updated the instance,
during that process it is altered with extra spaces and new lines, for
example a part of the document before passing through the pageflow is:

               <xsl:attribute name="href">getBinData?file=<xsl:value-of
select="."/></xsl:attribute>
       

And after pass the pageflow is:

                                    <xsl:attribute
name="href">getBinData?file=
                                        <xsl:value-of select="."/>
                                    </xsl:attribute>


Please note that a new line is after the "=", in the original document the
"=" is following by "<xsl:value-of ..." and not for a new line.
 
Debugging the Orbeon's code and I've realized that org.orbeon.oxf.xml.dom4j.
Dom4jUtils.domToString(Branch , boolean, boolean ) is called and this method
applies a new format to the original Document

This is the log4j displayed in the console before the document is altered
DEBUG XFormsInput - 3) Instance with model item properties applied:


I need to avoid that modifications to the original document, is there any
configuration parameter to set manually the OutputFormat.

Why does orbeon use domToString(), instead Document.asXML()?

Why does orbeon need to reformat the instance such as a pretty print?


Thanks in advance,

Claudio






--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XML modified by domToString

Erik Bruchez
Administrator
Claudio,

I think you are right, the document should not be reformatted here.

I am not sure why domToString() is used instead of the built-in
function. I assume that there was a bug at some point which triggered
that decision.

Are you in a position to produce a stack trace showing who is calling
the offending domToString()?

-Erik

Claudio Delgado wrote:

> All,
>
>
> I have a document that pass through the page flow and updated the instance,
> during that process it is altered with extra spaces and new lines, for
> example a part of the document before passing through the pageflow is:
>
>       <xsl:attribute name="href">getBinData?file=<xsl:value-of
> select="."/></xsl:attribute>
>
>
> And after pass the pageflow is:
>
>                                     <xsl:attribute
> name="href">getBinData?file=
>                                         <xsl:value-of select="."/>
>                                     </xsl:attribute>
>
>
> Please note that a new line is after the "=", in the original document the
> "=" is following by "<xsl:value-of ..." and not for a new line.
>  
> Debugging the Orbeon's code and I've realized that org.orbeon.oxf.xml.dom4j.
> Dom4jUtils.domToString(Branch , boolean, boolean ) is called and this method
> applies a new format to the original Document
>
> This is the log4j displayed in the console before the document is altered
> DEBUG XFormsInput - 3) Instance with model item properties applied:
>
>
> I need to avoid that modifications to the original document, is there any
> configuration parameter to set manually the OutputFormat.
>
> Why does orbeon use domToString(), instead Document.asXML()?
>
> Why does orbeon need to reformat the instance such as a pretty print?
>
>
> Thanks in advance,
>
> Claudio
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: XML modified by domToString

Claudio Delgado
Erik,

Attached you will find the log trace when the document is modified.

Our problem was solved by a workaround, I hope this trace helps.

Sorry for the delay in my response.

Best Regards,

Claudio Delgado
Software AG Factory
Valparaíso, Chile

-----Mensaje original-----
De: Erik Bruchez [mailto:[hidden email]] En nombre de Erik Bruchez
Enviado el: jueves, 11 de mayo de 2006 18:52
Para: [hidden email]
Asunto: Re: [ops-users] XML modified by domToString

Claudio,

I think you are right, the document should not be reformatted here.

I am not sure why domToString() is used instead of the built-in
function. I assume that there was a bug at some point which triggered
that decision.

Are you in a position to produce a stack trace showing who is calling
the offending domToString()?

-Erik

Claudio Delgado wrote:
> All,
>
>
> I have a document that pass through the page flow and updated the
instance,

> during that process it is altered with extra spaces and new lines, for
> example a part of the document before passing through the pageflow is:
>
>       <xsl:attribute name="href">getBinData?file=<xsl:value-of
> select="."/></xsl:attribute>
>
>
> And after pass the pageflow is:
>
>                                     <xsl:attribute
> name="href">getBinData?file=
>                                         <xsl:value-of select="."/>
>                                     </xsl:attribute>
>
>
> Please note that a new line is after the "=", in the original document the
> "=" is following by "<xsl:value-of ..." and not for a new line.
>  
> Debugging the Orbeon's code and I've realized that
org.orbeon.oxf.xml.dom4j.
> Dom4jUtils.domToString(Branch , boolean, boolean ) is called and this
method

> applies a new format to the original Document
>
> This is the log4j displayed in the console before the document is altered
> DEBUG XFormsInput - 3) Instance with model item properties applied:
>
>
> I need to avoid that modifications to the original document, is there any
> configuration parameter to set manually the OutputFormat.
>
> Why does orbeon use domToString(), instead Document.asXML()?
>
> Why does orbeon need to reformat the instance such as a pretty print?
>
>
> Thanks in advance,
>
> Claudio
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/


domToStringFormatProblem.txt (59K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: XML modified by domToString

Alessandro  Vernet
Administrator
Claudio,

When you use debug="..." in XPL, the DebugProcessor gets called. And
the in the DebugProcessor we use Dom4jUtils.domToString(). However
this just impacts how the document is logged. It does not modify the
document itself.

We have chosen to reformat the document when logging, because it helps
in most cases. Now I agree that there are cases where you would really
like to see exactly the exact document and you wouldn't like the
DebugProcessor to re-indent your XML. Maybe we could add a property to
disable indenting. Would that work for you?

Alex

On 5/19/06, Claudio Delgado <[hidden email]> wrote:

> Erik,
>
> Attached you will find the log trace when the document is modified.
>
> Our problem was solved by a workaround, I hope this trace helps.
>
> Sorry for the delay in my response.
>
> Best Regards,
>
> Claudio Delgado
> Software AG Factory
> Valparaíso, Chile
>
> -----Mensaje original-----
> De: Erik Bruchez [mailto:[hidden email]] En nombre de Erik Bruchez
> Enviado el: jueves, 11 de mayo de 2006 18:52
> Para: [hidden email]
> Asunto: Re: [ops-users] XML modified by domToString
>
> Claudio,
>
> I think you are right, the document should not be reformatted here.
>
> I am not sure why domToString() is used instead of the built-in
> function. I assume that there was a bug at some point which triggered
> that decision.
>
> Are you in a position to produce a stack trace showing who is calling
> the offending domToString()?
>
> -Erik
>
> Claudio Delgado wrote:
> > All,
> >
> >
> > I have a document that pass through the page flow and updated the
> instance,
> > during that process it is altered with extra spaces and new lines, for
> > example a part of the document before passing through the pageflow is:
> >
> >              <xsl:attribute name="href">getBinData?file=<xsl:value-of
> > select="."/></xsl:attribute>
> >
> >
> > And after pass the pageflow is:
> >
> >                                     <xsl:attribute
> > name="href">getBinData?file=
> >                                         <xsl:value-of select="."/>
> >                                     </xsl:attribute>
> >
> >
> > Please note that a new line is after the "=", in the original document the
> > "=" is following by "<xsl:value-of ..." and not for a new line.
> >
> > Debugging the Orbeon's code and I've realized that
> org.orbeon.oxf.xml.dom4j.
> > Dom4jUtils.domToString(Branch , boolean, boolean ) is called and this
> method
> > applies a new format to the original Document
> >
> > This is the log4j displayed in the console before the document is altered
> > DEBUG XFormsInput - 3) Instance with model item properties applied:
> >
> >
> > I need to avoid that modifications to the original document, is there any
> > configuration parameter to set manually the OutputFormat.
> >
> > Why does orbeon use domToString(), instead Document.asXML()?
> >
> > Why does orbeon need to reformat the instance such as a pretty print?
> >
> >
> > Thanks in advance,
> >
> > Claudio
>
> --
> Orbeon - XForms Everywhere:
> http://www.orbeon.com/blog/
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: XML modified by domToString

Claudio Delgado
Thanks for you answer...

I think that could be fine for us...

Thanks,

Claudio

-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de Alessandro
Vernet
Enviado el: viernes, 19 de mayo de 2006 18:51
Para: [hidden email]
Asunto: Re: [ops-users] XML modified by domToString

Claudio,

When you use debug="..." in XPL, the DebugProcessor gets called. And
the in the DebugProcessor we use Dom4jUtils.domToString(). However
this just impacts how the document is logged. It does not modify the
document itself.

We have chosen to reformat the document when logging, because it helps
in most cases. Now I agree that there are cases where you would really
like to see exactly the exact document and you wouldn't like the
DebugProcessor to re-indent your XML. Maybe we could add a property to
disable indenting. Would that work for you?

Alex

On 5/19/06, Claudio Delgado <[hidden email]> wrote:

> Erik,
>
> Attached you will find the log trace when the document is modified.
>
> Our problem was solved by a workaround, I hope this trace helps.
>
> Sorry for the delay in my response.
>
> Best Regards,
>
> Claudio Delgado
> Software AG Factory
> Valparaíso, Chile
>
> -----Mensaje original-----
> De: Erik Bruchez [mailto:[hidden email]] En nombre de Erik Bruchez
> Enviado el: jueves, 11 de mayo de 2006 18:52
> Para: [hidden email]
> Asunto: Re: [ops-users] XML modified by domToString
>
> Claudio,
>
> I think you are right, the document should not be reformatted here.
>
> I am not sure why domToString() is used instead of the built-in
> function. I assume that there was a bug at some point which triggered
> that decision.
>
> Are you in a position to produce a stack trace showing who is calling
> the offending domToString()?
>
> -Erik
>
> Claudio Delgado wrote:
> > All,
> >
> >
> > I have a document that pass through the page flow and updated the
> instance,
> > during that process it is altered with extra spaces and new lines, for
> > example a part of the document before passing through the pageflow is:
> >
> >              <xsl:attribute name="href">getBinData?file=<xsl:value-of
> > select="."/></xsl:attribute>
> >
> >
> > And after pass the pageflow is:
> >
> >                                     <xsl:attribute
> > name="href">getBinData?file=
> >                                         <xsl:value-of select="."/>
> >                                     </xsl:attribute>
> >
> >
> > Please note that a new line is after the "=", in the original document
the
> > "=" is following by "<xsl:value-of ..." and not for a new line.
> >
> > Debugging the Orbeon's code and I've realized that
> org.orbeon.oxf.xml.dom4j.
> > Dom4jUtils.domToString(Branch , boolean, boolean ) is called and this
> method
> > applies a new format to the original Document
> >
> > This is the log4j displayed in the console before the document is
altered
> > DEBUG XFormsInput - 3) Instance with model item properties applied:
> >
> >
> > I need to avoid that modifications to the original document, is there
any

> > configuration parameter to set manually the OutputFormat.
> >
> > Why does orbeon use domToString(), instead Document.asXML()?
> >
> > Why does orbeon need to reformat the instance such as a pretty print?
> >
> >
> > Thanks in advance,
> >
> > Claudio
>
> --
> Orbeon - XForms Everywhere:
> http://www.orbeon.com/blog/
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email]
mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>
>


--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XML modified by domToString

Alessandro  Vernet
Administrator
On 5/19/06, Claudio Delgado <[hidden email]> wrote:
> I think that could be fine for us...

Claudio,

Alright, then I recorded a request for enhancement, but I can't
guarantee when this will be done:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305320&group_id=168&atid=350207

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: XML modified by domToString

Claudio Delgado
Alex,

I forgot say that problem also happens with the debug set as OFF.

Regards,

Claudio
-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]] En nombre de Alessandro
Vernet
Enviado el: viernes, 19 de mayo de 2006 19:53
Para: [hidden email]
Asunto: Re: [ops-users] XML modified by domToString

On 5/19/06, Claudio Delgado <[hidden email]> wrote:
> I think that could be fine for us...

Claudio,

Alright, then I recorded a request for enhancement, but I can't
guarantee when this will be done:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305320&group_id
=168&atid=350207

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XML modified by domToString

Alessandro  Vernet
Administrator
Claudio,

If the reformatting is unrelated to using the "debug" attribute in
XPL, then the behavior your are describing is certainly unexpected and
it looks like it could be caused by a bug. If you can reproduce this
and manages to create an example that shows this, we would be very
interested in having a look at it.

Alex

On 5/22/06, Claudio Delgado <[hidden email]> wrote:

> Alex,
>
> I forgot say that problem also happens with the debug set as OFF.
>
> Regards,
>
> Claudio
> -----Mensaje original-----
> De: [hidden email] [mailto:[hidden email]] En nombre de Alessandro
> Vernet
> Enviado el: viernes, 19 de mayo de 2006 19:53
> Para: [hidden email]
> Asunto: Re: [ops-users] XML modified by domToString
>
> On 5/19/06, Claudio Delgado <[hidden email]> wrote:
> > I think that could be fine for us...
>
> Claudio,
>
> Alright, then I recorded a request for enhancement, but I can't
> guarantee when this will be done:
>
> http://forge.objectweb.org/tracker/index.php?func=detail&aid=305320&group_id
> =168&atid=350207
>
> Alex
> --
> Blog (XML, Web apps, Open Source):
> http://www.orbeon.com/blog/
>
>
>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

OPS xpath debugging

Stefan Mueller
In reply to this post by Claudio Delgado
Hi everybody,

I'm new to OPS and having trouble to build my first application. I have the
  " <xforms:group ref="instance('main-instance')/documents/*">"
instruction but "documents" are not being matched against my XML data
structure. "main-instance" without "/documents/*" works.

For debug purposes, is it possible to display the names of all nodes
that are available after the "<xforms:group
ref="instance('main-instance')"> instruction is being executed? E.g.
with an Xpath expression to xforms:output or something like that?

Thanks!!!

Best regards,
Stefan



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: OPS xpath debugging

Erik Bruchez
Administrator
Stefan Mueller wrote:
> Hi everybody,
>
> I'm new to OPS and having trouble to build my first application. I have the
>  " <xforms:group ref="instance('main-instance')/documents/*">"
> instruction but "documents" are not being matched against my XML data
> structure. "main-instance" without "/documents/*" works.

You don't say what you instance looks like, so it's hard to tell. But
you should know that the XForms instance() function returns the root
*element* of the instance document, not the root *node*.

> For debug purposes, is it possible to display the names of all nodes
> that are available after the "<xforms:group
> ref="instance('main-instance')"> instruction is being executed? E.g.
> with an Xpath expression to xforms:output or something like that?

Try, within <xforms:group>, something like:

Test: <xforms:output value="string-join(for $i in * return name($i), ' /
')"/>.

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws