Luis Rodriguez Gonzalez has proposed merging lp:~zorba-coders/zorba/1181360 into lp:zorba.
Requested reviews: Luis Rodriguez Gonzalez (kuraru) Cezar Andrei (cezar-andrei) For more details, see: https://code.launchpad.net/~zorba-coders/zorba/1181360/+merge/167690 -- https://code.launchpad.net/~zorba-coders/zorba/1181360/+merge/167690 Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/diagnostics/diagnostic_en.xml' --- src/diagnostics/diagnostic_en.xml 2013-06-04 00:34:52 +0000 +++ src/diagnostics/diagnostic_en.xml 2013-06-06 04:36:34 +0000 @@ -3676,6 +3676,10 @@ <entry key="DocNodeMultipleElements"> <value>document node has more than one element</value> </entry> + + <entry key="DocNodeNoElements"> + <value>document node doesn't contain any elements, must contain exactly one element</value> + </entry> <entry key="EBVNotDefSeq_5"> <value>effective boolean value not defined for sequence of more than one item that starts with "$5"</value> === modified file 'src/diagnostics/pregenerated/dict_en.cpp' --- src/diagnostics/pregenerated/dict_en.cpp 2013-06-04 01:32:30 +0000 +++ src/diagnostics/pregenerated/dict_en.cpp 2013-06-06 04:36:34 +0000 @@ -610,6 +610,7 @@ { "~DivisionNoINF", "division can not have +-INF dividend" }, { "~DivisionNoNaN", "division can not involve NaN" }, { "~DocNodeMultipleElements", "document node has more than one element" }, + { "~DocNodeNoElements", "document node doesn't contain any elements, must contain exactly one element" }, { "~EBVNotDefSeq_5", "effective boolean value not defined for sequence of more than one item that starts with \"$5\"" }, { "~EffectiveBooleanValue", "effective boolean value" }, { "~ElementName", "element name" }, === modified file 'src/diagnostics/pregenerated/dict_zed_keys.h' --- src/diagnostics/pregenerated/dict_zed_keys.h 2013-05-16 22:26:07 +0000 +++ src/diagnostics/pregenerated/dict_zed_keys.h 2013-06-06 04:36:34 +0000 @@ -223,6 +223,7 @@ #define ZED_DivisionNoINF "~DivisionNoINF" #define ZED_DivisionNoNaN "~DivisionNoNaN" #define ZED_DocNodeMultipleElements "~DocNodeMultipleElements" +#define ZED_DocNodeNoElements "~DocNodeNoElements" #define ZED_EBVNotDefSeq_5 "~EBVNotDefSeq_5" #define ZED_EffectiveBooleanValue "~EffectiveBooleanValue" #define ZED_ElementName "~ElementName" === modified file 'src/types/schema/validate.cpp' --- src/types/schema/validate.cpp 2013-05-21 21:44:25 +0000 +++ src/types/schema/validate.cpp 2013-06-06 04:36:34 +0000 @@ -136,6 +136,15 @@ nr_child_elements++; } } + // if nr_child_elements == 0 thow an error since it means there isn't any child element + if(nr_child_elements == 0) + { + throw XQUERY_EXCEPTION( + err::XQDY0061, + ERROR_PARAMS( ZED( DocNodeNoElements ) ), + ERROR_LOC( loc ) + ); + } } Schema* schema = typeManager->getSchema();
-- Mailing list: https://launchpad.net/~zorba-coders Post to : zorba-coders@lists.launchpad.net Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp