whitespace pruning while storing an XML doc to BaseX, how to disable
Tuesday, 21 June 2011 · 3 messages
SD
software developer21 Jun 2011 16:33 #
Hi,
Does BaseX attempt some whitespace pruning on the XMLs being stored; if yes, how to get BaseX not to do so.
On the wire, at the time request reaches BaseX, the XML is like: ..<xsl:for-each select="LINK">
...<xsl:if test="A = 'TOKEN'">
....insert into
....MYTABLE(VERSION)
....values ('LATEST');
...</xsl:if>
. in above is a space character, note the terminating xsl:if is on a line of its own.
What BaseX stores is:
<xsl:for-each select="LINK">
<xsl:if test="A = 'TOKEN'">insert into
MYTABLE(VERSION)
values ('LATEST');</xsl:if>
</xsl:for-each>As you can see, BaseX has not persisted/stored the incoming XML as-is. I do not want this intelligent pruning since it breaks stuff for me.
Thanks.
SD
software developer21 Jun 2011 16:41 #
I use JAX-RX server, which does not have the option -w
available/listed to presreve whitespace as-is.
So, how to preserve XML files being loaded to BaseX using JAX-RX as-is.
---------- Forwarded message ----------
Quoted text · software developer · 25 lines
From: software developer <computer.software.developer at gmail.com> Date: Tue, Jun 21, 2011 at 3:33 PM Subject: whitespace pruning while storing an XML doc to BaseX, how to disable To: basex-talk at mailman.uni-konstanz.de Hi, Does BaseX attempt some whitespace pruning on the XMLs being stored; if yes, how to get BaseX not to do so. On the wire, at the time request reaches BaseX, the XML is like: ..<xsl:for-each select="LINK"> ...<xsl:if test="A = 'TOKEN'"> ....insert into ....MYTABLE(VERSION) ....values ('LATEST'); ...</xsl:if> . in above is a space character, note the terminating xsl:if is on a line of its own. What BaseX stores is: <xsl:for-each select="LINK"> <xsl:if test="A = 'TOKEN'">insert into MYTABLE(VERSION) values ('LATEST');</xsl:if> </xsl:for-each> As you can see, BaseX has not persisted/stored the incoming XML as-is. I do not want this intelligent pruning since it breaks stuff for me. Thanks.
DP
Hi,
please check our documentation: http://docs.basex.org/wiki/Options what you need is the CHOP option when you create your database.
Cheers,
Dimitar
Quoted text · 16:33:20 · 33 lines
Am Dienstag 21 Juni 2011, 16:33:20 schrieb software developer: > Hi, > > Does BaseX attempt some whitespace pruning on the XMLs being stored; > if yes, how to get BaseX not to do so. > > On the wire, at the time request reaches BaseX, the XML is like: > ..<xsl:for-each select="LINK"> > > ...<xsl:if test="A = 'TOKEN'"> > ....insert into > ....MYTABLE(VERSION) > ....values ('LATEST'); > ...</xsl:if> > > . in above is a space character, note the terminating xsl:if is on a > line of its own. > > What BaseX stores is: > <xsl:for-each select="LINK"> > <xsl:if test="A = 'TOKEN'">insert into > MYTABLE(VERSION) > values ('LATEST');</xsl:if> > </xsl:for-each> > > As you can see, BaseX has not persisted/stored the incoming XML as-is. > I do not want this intelligent pruning since it breaks stuff for me. > > Thanks. > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Written for BaseX 6.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery