You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Savita <sa...@india.hp.com> on 2002/07/08 08:52:53 UTC

XML Transformation , problem


Torsten Curdt wrote:

> when using latest xerces2 (CVS) I get two error handler calls for a single
> failed constraint. Can someone please explain if this was indended? I don't
> see a good reason for that.
>
> org.xml.sax.SAXParseException:
> cvc-minInclusive-valid:
>  Value '2' is not facet-valid with respect to minInclusive '50'.
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)
> ...
>
> and
>
> org.xml.sax.SAXParseException:
> cvc-type.3.1.3:
>  The value '2' of element 'number' is not valid.
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)
> ...
>
> An I am also wondering if it is already possible to get some more information
> from the SAXException.
>
> a) the full path to the node that cause the error
>
> b) not just a text message but an object (some kind of constraint or facet
> object) that makes machine based processing based on the validation result
> possible. AFAICS the current information is only useful if you want to pass
> it directly to a user. I'd need to parse it to get the desired information.
> (but that would ugly as hell...)
>
> Or is there already a way to get the information:
>
>  minInclusive
>  value-is: 2
>  value-is-supposed-to-be: 50
>
> out of the above exception?
>
> Thanks
> --
> Torsten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org

Hi all,

I want to perform a xml transformation .I have a XSL file which contains the SQL statements.

I am checking in this file like this

update OS_CUSTOMER set
    <xsl:if test="(count(CUSTOMER/FIRST_NAME) = 1)">
         FIRST_NAME='<xsl:value-of select="CUSTOMER/FIRST_NAME"/>'
        </xsl:if>
         <xsl:if test="(count(CUSTOMER/LAST_NAME) = 1)">
             ,LAST_NAME='<xsl:value-of select="CUSTOMER/LAST_NAME"/>'
        </xsl:if>
     <xsl:if test="(count(CUSTOMER/CONTACT_TYPE) = 1)">
         ,CONTACT_TYPE='<xsl:value-of select="CUSTOMER/CONTACT_TYPE"/>'
    </xsl:if>
    <xsl:if test="(count(CUSTOMER/ADDRESS_1) = 1)">
         ,ADDRESS_1='<xsl:value-of select="CUSTOMER/ADDRESS_1"/>'
    </xsl:if>

Here I am facing a problem with transformation ,If the first element FIRST_NAME is not present it
will put a , infront of LAST_NAME then the update statement will become invalid .Is there any way in
the API where we can avoid putting the , infront of the second element.


--
Best Regards
-Savita
-------------------------
Hewlett Packard (India)
+91 80 2051288 (Phone)
847 1288 (HP Telnet)
-------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


XML Transformation , problem

Posted by Savita <sa...@india.hp.com>.
Hi all,

I want to perform a xml transformation .I have a XSL file which contains the SQL statements.

I am checking in this file like this

update OS_CUSTOMER set
    <xsl:if test="(count(CUSTOMER/FIRST_NAME) = 1)">
         FIRST_NAME='<xsl:value-of select="CUSTOMER/FIRST_NAME"/>'
        </xsl:if>
         <xsl:if test="(count(CUSTOMER/LAST_NAME) = 1)">
             ,LAST_NAME='<xsl:value-of select="CUSTOMER/LAST_NAME"/>'
        </xsl:if>
     <xsl:if test="(count(CUSTOMER/CONTACT_TYPE) = 1)">
         ,CONTACT_TYPE='<xsl:value-of select="CUSTOMER/CONTACT_TYPE"/>'
    </xsl:if>
    <xsl:if test="(count(CUSTOMER/ADDRESS_1) = 1)">
         ,ADDRESS_1='<xsl:value-of select="CUSTOMER/ADDRESS_1"/>'
    </xsl:if>

Here I am facing a problem with transformation ,If the first element FIRST_NAME is not present it
will put a , infront of LAST_NAME then the update statement will become invalid .Is there any way in
the API where we can avoid putting the , infront of the second element.



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org