Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » How to test an element specified in the input xml or not?
How to test an element specified in the input xml or not? [message #40917] Thu, 24 January 2008 10:45 Go to next message
hamlin is currently offline hamlinFriend
Messages: 8
Registered: July 2009
Junior Member
Hi all,
What's the correct way to test whether an element specified in the input
xml or not if the input xml is associated with its own schema (use
xsi:noNamespaceSchemaLocation="test.xsd")? The code "<c:if
test="root/subelement">...</c:if>" seems doesn't work in this case and
throw java.lang.NullPointerException most of the time.

Another question is that, how to tell JET Transformation the path of the
schema? Currently, I have to copy the schema file to the path which holds
the input xml file.
Re: How to test an element specified in the input xml or not? [message #40980 is a reply to message #40917] Thu, 24 January 2008 16:15 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Chaohong:

Please submit a bugzilla for the NullPointerException. Attaching a stack
trace from the Error Log view will be most helpful. Here's the URL to submit
a bug:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2T& version=unspecified&component=Jet&rep_platform=PC&am p;op_sys=Windows%20XP&priority=P3&bug_severity=norma l&bug_status=NEW&bug_file_loc=http%3A%2F%2F&shor t_desc=&comment=&commentprivacy=0&keywords=& dependson=&blocked=&maketemplate=Remember%20values%2 0as%20bookmarkable%20template&form_name=enter_bug&as signed_to=m2t.jet-inbox%40eclipse.org

But, I think there is a solution to your problem without me fixing a bug...

You have:

<c:if test="root/subelement">
....
</c:if>

Try one of the following:
1) Make your XPath expression absolute: /root/subelement
2) Start your XPath expressino with a known variable: $root/subelement

In either case, the expression should evaluate to 'true' if one or more
subelement instances are found.

Paul



"Chaohong" <hamlinxie@gmail.com> wrote in message
news:80963715da268e4f77c0aee616ebeba9$1@www.eclipse.org...
> Hi all,
> What's the correct way to test whether an element specified in the input
> xml or not if the input xml is associated with its own schema (use
> xsi:noNamespaceSchemaLocation="test.xsd")? The code "<c:if
> test="root/subelement">...</c:if>" seems doesn't work in this case and
> throw java.lang.NullPointerException most of the time.
>
> Another question is that, how to tell JET Transformation the path of the
> schema? Currently, I have to copy the schema file to the path which holds
> the input xml file.
>
Re: How to test an element specified in the input xml or not? [message #41105 is a reply to message #40980] Sun, 27 January 2008 16:03 Go to previous messageGo to next message
hamlin is currently offline hamlinFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Paul,
Sorry for this late response. I have been stuck by this problem now. I
tried your suggestions but that don't work for me. I'd like to make sure
whether it is my carelessness somewhere or it is a bug of JET before
submitting the bug.

I have to paste my test project and the stack trace at the end so that you
can understand my problem. Sorry for this long letter in advance.

I noticed that whenever I add "xsi:noNamespaceSchemaLocation="test.xsd""
in the sample.xml, the NullPointerException will reoccur easily. While the
<c:if test /> tag works fine if I remove that text out of the sample.xml.

BR,

Chaohong

stack trace
=====================================
java.lang.NullPointerException
at
org.eclipse.jet.internal.xpath.ast.Axis$AttributeAxis.evalua te(Axis.java:119)
at org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Step.j ava:77)
at
org.eclipse.jet.internal.xpath.ast.NodeSetExpr.evalAsObject( NodeSetExpr.java:44)
at
org.eclipse.jet.internal.xpath.XPathExpressionImpl.evaluate( XPathExpressionImpl.java:59)
at
org.eclipse.jet.XPathContextExtender.resolveAsObject(XPathCo ntextExtender.java:444)
at
org.eclipse.jet.XPathContextExtender.resolveAsString(XPathCo ntextExtender.java:141)
at org.eclipse.jet.internal.taglib.control.GetTag.doAction(GetT ag.java:53)
at
org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag$1.doRun (SafeEmptyRuntimeTag.java:49)
at
org.eclipse.jet.internal.runtime.SafeCustomRuntimeTag$TagSaf eRunnable.run(SafeCustomRuntimeTag.java:72)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at
org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag.doStart (SafeEmptyRuntimeTag.java:43)
at org.eclipse.jet.compiled._jet_dump1.generate(_jet_dump1.java :78)
at
org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:146)
at
org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:119)
at
org.eclipse.jet.internal.taglib.workspace.FileTag.doAction(F ileTag.java:101)
at
org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag$1.doRun (SafeEmptyRuntimeTag.java:49)
at
org.eclipse.jet.internal.runtime.SafeCustomRuntimeTag$TagSaf eRunnable.run(SafeCustomRuntimeTag.java:72)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at
org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag.doStart (SafeEmptyRuntimeTag.java:43)
at org.eclipse.jet.compiled._jet_main.generate(_jet_main.java:4 1)
at
org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:146)
at
org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:119)
at org.eclipse.jet.JET2Platform$5.run(JET2Platform.java:458)
at
org.eclipse.jet.internal.runtime.JETBundleManager.run(JETBun dleManager.java:331)
at org.eclipse.jet.JET2Platform.runTransform(JET2Platform.java: 426)
at org.eclipse.jet.internal.launch.JETProcess.run(JETProcess.ja va:156)
at
org.eclipse.jet.internal.launch.JET2TransformationDelegate.l aunch(JET2TransformationDelegate.java:59)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:766)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
=====================================

dump.jet
=====================================
<?xml version="1.0" encoding="utf-8"?>
<c:if test="/datasource/raw" var="ds1">
Raw ds is <c:get select="$ds1/@uri"/>.
</c:if>
<c:if test="/datasource/aggregated" var="ds2">
<c:if test="$ds2/query" var="query">
Query language is <c:get select="$query/@language"/>.
</c:if>
</c:if>
=====================================

sample.xml
=====================================
<?xml version="1.0" encoding="UTF-8"?>
<datasource name="AggregatedCalendar"
xsi:noNamespaceSchemaLocation="test.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<aggregated>
<query language="mysql">
<![CDATA[
SELECT Calendar.TestEvent AS Event
FROM MyCalendar AS Calendar;
]]>
</query>
</aggregated>
</datasource>
=====================================

test.xsd
=====================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sdi="http://www.motorola.com/sdi" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="datasource">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element name="raw">
<xs:complexType>
<xs:attribute name="uri" use="required">
</xs:attribute>
<xs:attribute name="type">
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="aggregated">
<xs:complexType>
<xs:sequence>
<xs:element name="query">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:anySimpleType">
<xs:attribute name="language" use="required">
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" use="required">
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
=====================================



Paul Elder wrote:

> Chaohong:

> Please submit a bugzilla for the NullPointerException. Attaching a stack
> trace from the Error Log view will be most helpful. Here's the URL to submit
> a bug:

>
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2T& version=unspecified&component=Jet&rep_platform=PC&am p;op_sys=Windows%20XP&priority=P3&bug_severity=norma l&bug_status=NEW&bug_file_loc=http%3A%2F%2F&shor t_desc=&comment=&commentprivacy=0&keywords=& dependson=&blocked=&maketemplate=Remember%20values%2 0as%20bookmarkable%20template&form_name=enter_bug&as signed_to=m2t.jet-inbox%40eclipse.org

> But, I think there is a solution to your problem without me fixing a bug...

> You have:

> <c:if test="root/subelement">
> ....
> </c:if>

> Try one of the following:
> 1) Make your XPath expression absolute: /root/subelement
> 2) Start your XPath expressino with a known variable: $root/subelement

> In either case, the expression should evaluate to 'true' if one or more
> subelement instances are found.

> Paul
Re: How to test an element specified in the input xml or not? [message #41137 is a reply to message #41105] Sun, 27 January 2008 16:07 Go to previous messageGo to next message
hamlin is currently offline hamlinFriend
Messages: 8
Registered: July 2009
Junior Member
BTW, the main.jet isn't attached for it is just created by JET by default.
Thanks.

BR,

Chaohong
Re: How to test an element specified in the input xml or not? [message #41228 is a reply to message #41137] Thu, 31 January 2008 16:36 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Chaohong:

Can you attach the schema, the test document, and XPath expression that is
failing? I have not been able to reproduce from the information you have
provided.

Paul

"Chaohong" <hamlinxie@gmail.com> wrote in message
news:ccdc0b731c6ae21508b2809a304a336a$1@www.eclipse.org...
> BTW, the main.jet isn't attached for it is just created by JET by default.
> Thanks.
>
> BR,
>
> Chaohong
>
Re: How to test an element specified in the input xml or not? [message #41257 is a reply to message #41228] Fri, 01 February 2008 02:41 Go to previous messageGo to next message
hamlin is currently offline hamlinFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Paul,
For your convenient, here is the attached. Please create an "EMFT JET
Transformation Project", paste the following content into corresponding
files and then run the transformation. The NullPointerException should
catch you there. Or, you can fetch the test project from here
(https://bugs.eclipse.org/bugs/attachment.cgi?id=88492).

I found a bug submitted
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=217057) reporting such an
issue. Could you have a look as well? Thanks a lot.

stack trace
=====================================
java.lang.NullPointerException
at
org.eclipse.jet.internal.xpath.ast.Axis$AttributeAxis.evalua te(Axis.java:119)
at org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Step.j ava:77)
at
org.eclipse.jet.internal.xpath.ast.NodeSetExpr.evalAsObject( NodeSetExpr.java:44)
at
org.eclipse.jet.internal.xpath.XPathExpressionImpl.evaluate( XPathExpressionImpl.java:59)
at
org.eclipse.jet.XPathContextExtender.resolveAsObject(XPathCo ntextExtender.java:444)
at
org.eclipse.jet.XPathContextExtender.resolveAsString(XPathCo ntextExtender.java:141)
at org.eclipse.jet.internal.taglib.control.GetTag.doAction(GetT ag.java:53)
at
org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag$1.doRun (SafeEmptyRuntimeTag.java:49)
at
org.eclipse.jet.internal.runtime.SafeCustomRuntimeTag$TagSaf eRunnable.run(SafeCustomRuntimeTag.java:72)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at
org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag.doStart (SafeEmptyRuntimeTag.java:43)
at org.eclipse.jet.compiled._jet_dump1.generate(_jet_dump1.java :78)
at
org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:146)
at
org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:119)
at
org.eclipse.jet.internal.taglib.workspace.FileTag.doAction(F ileTag.java:101)
at
org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag$1.doRun (SafeEmptyRuntimeTag.java:49)
at
org.eclipse.jet.internal.runtime.SafeCustomRuntimeTag$TagSaf eRunnable.run(SafeCustomRuntimeTag.java:72)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at
org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag.doStart (SafeEmptyRuntimeTag.java:43)
at org.eclipse.jet.compiled._jet_main.generate(_jet_main.java:4 1)
at
org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:146)
at
org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:119)
at org.eclipse.jet.JET2Platform$5.run(JET2Platform.java:458)
at
org.eclipse.jet.internal.runtime.JETBundleManager.run(JETBun dleManager.java:331)
at org.eclipse.jet.JET2Platform.runTransform(JET2Platform.java: 426)
at org.eclipse.jet.internal.launch.JETProcess.run(JETProcess.ja va:156)
at
org.eclipse.jet.internal.launch.JET2TransformationDelegate.l aunch(JET2TransformationDelegate.java:59)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:766)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
=====================================

dump.jet
=====================================
<?xml version="1.0" encoding="utf-8"?>
<c:if test="/datasource/raw" var="ds1">
Raw ds is <c:get select="$ds1/@uri"/>.
</c:if>
<c:if test="/datasource/aggregated" var="ds2">
<c:if test="$ds2/query" var="query">
Query language is <c:get select="$query/@language"/>.
</c:if>
</c:if>
=====================================

sample.xml
=====================================
<?xml version="1.0" encoding="UTF-8"?>
<datasource name="AggregatedCalendar"
xsi:noNamespaceSchemaLocation="test.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<aggregated>
<query language="mysql">
<![CDATA[
SELECT Calendar.TestEvent AS Event
FROM MyCalendar AS Calendar;
]]>
</query>
</aggregated>
</datasource>
=====================================

test.xsd
=====================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sdi="http://www.motorola.com/sdi" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="datasource">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:element name="raw">
<xs:complexType>
<xs:attribute name="uri" use="required">
</xs:attribute>
<xs:attribute name="type">
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="aggregated">
<xs:complexType>
<xs:sequence>
<xs:element name="query">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:anySimpleType">
<xs:attribute name="language" use="required">
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" use="required">
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
=====================================

B.R.

Chaohong


Paul Elder wrote:

> Chaohong:

> Can you attach the schema, the test document, and XPath expression that is
> failing? I have not been able to reproduce from the information you have
> provided.

> Paul
Re: How to test an element specified in the input xml or not? [message #41288 is a reply to message #41257] Tue, 05 February 2008 19:08 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Thanks fro the information.

FYI. I have committed a change that at least resolves the NPE.

Bug, the underlying problem is you have the following code:

<c:if test="/datasource/raw" var="ds1">
Raw ds is <c:get select="$ds1/@uri"/>.
</c:if>

The fix corrects a problem where /datasource/raw was evaluating to 'true',
and setting $ds1 to null, thus causing the follow-on problem in c:get (which
has also been fixed).

The fix will be included in this weeks maintenance build.

Paul

"Chaohong" <hamlinxie@gmail.com> wrote in message
news:9a9e3e691d2bddeea0176df04115e32d$1@www.eclipse.org...
> Hi Paul,
> For your convenient, here is the attached. Please create an "EMFT JET
> Transformation Project", paste the following content into corresponding
> files and then run the transformation. The NullPointerException should
> catch you there. Or, you can fetch the test project from here
> (https://bugs.eclipse.org/bugs/attachment.cgi?id=88492).
> I found a bug submitted
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=217057) reporting such an
> issue. Could you have a look as well? Thanks a lot.
>
> stack trace
> =====================================
> java.lang.NullPointerException
> at
> org.eclipse.jet.internal.xpath.ast.Axis$AttributeAxis.evalua te(Axis.java:119)
> at org.eclipse.jet.internal.xpath.ast.Step.evalAsNodeSet(Step.j ava:77)
> at
> org.eclipse.jet.internal.xpath.ast.NodeSetExpr.evalAsObject( NodeSetExpr.java:44)
> at
> org.eclipse.jet.internal.xpath.XPathExpressionImpl.evaluate( XPathExpressionImpl.java:59)
> at
> org.eclipse.jet.XPathContextExtender.resolveAsObject(XPathCo ntextExtender.java:444)
> at
> org.eclipse.jet.XPathContextExtender.resolveAsString(XPathCo ntextExtender.java:141)
> at org.eclipse.jet.internal.taglib.control.GetTag.doAction(GetT ag.java:53)
> at
> org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag$1.doRun (SafeEmptyRuntimeTag.java:49)
> at
> org.eclipse.jet.internal.runtime.SafeCustomRuntimeTag$TagSaf eRunnable.run(SafeCustomRuntimeTag.java:72)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
> at
> org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag.doStart (SafeEmptyRuntimeTag.java:43)
> at org.eclipse.jet.compiled._jet_dump1.generate(_jet_dump1.java :78)
> at
> org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:146)
> at
> org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:119)
> at
> org.eclipse.jet.internal.taglib.workspace.FileTag.doAction(F ileTag.java:101)
> at
> org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag$1.doRun (SafeEmptyRuntimeTag.java:49)
> at
> org.eclipse.jet.internal.runtime.SafeCustomRuntimeTag$TagSaf eRunnable.run(SafeCustomRuntimeTag.java:72)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
> at
> org.eclipse.jet.internal.runtime.SafeEmptyRuntimeTag.doStart (SafeEmptyRuntimeTag.java:43)
> at org.eclipse.jet.compiled._jet_main.generate(_jet_main.java:4 1)
> at
> org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:146)
> at
> org.eclipse.jet.transform.TransformContextExtender.execute(T ransformContextExtender.java:119)
> at org.eclipse.jet.JET2Platform$5.run(JET2Platform.java:458)
> at
> org.eclipse.jet.internal.runtime.JETBundleManager.run(JETBun dleManager.java:331)
> at org.eclipse.jet.JET2Platform.runTransform(JET2Platform.java: 426)
> at org.eclipse.jet.internal.launch.JETProcess.run(JETProcess.ja va:156)
> at
> org.eclipse.jet.internal.launch.JET2TransformationDelegate.l aunch(JET2TransformationDelegate.java:59)
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:766)
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> =====================================
>
> dump.jet
> =====================================
> <?xml version="1.0" encoding="utf-8"?>
> <c:if test="/datasource/raw" var="ds1">
> Raw ds is <c:get select="$ds1/@uri"/>.
> </c:if>
> <c:if test="/datasource/aggregated" var="ds2">
> <c:if test="$ds2/query" var="query">
> Query language is <c:get select="$query/@language"/>.
> </c:if>
> </c:if>
> =====================================
>
> sample.xml
> =====================================
> <?xml version="1.0" encoding="UTF-8"?>
> <datasource name="AggregatedCalendar"
> xsi:noNamespaceSchemaLocation="test.xsd"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <aggregated>
> <query language="mysql">
> <![CDATA[
> SELECT Calendar.TestEvent AS Event
> FROM MyCalendar AS Calendar;
> ]]>
> </query>
> </aggregated>
> </datasource>
> =====================================
>
> test.xsd
> =====================================
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:sdi="http://www.motorola.com/sdi" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:element name="datasource">
> <xs:complexType>
> <xs:sequence>
> <xs:choice>
> <xs:element name="raw">
> <xs:complexType>
> <xs:attribute name="uri" use="required">
> </xs:attribute>
> <xs:attribute name="type">
> </xs:attribute>
> </xs:complexType>
> </xs:element>
> <xs:element name="aggregated">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="query">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:anySimpleType">
> <xs:attribute name="language" use="required">
> </xs:attribute>
> </xs:extension>
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:choice>
> </xs:sequence>
> <xs:attribute name="name" use="required">
> </xs:attribute>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> =====================================
>
> B.R.
>
> Chaohong
>
>
> Paul Elder wrote:
>
>> Chaohong:
>
>> Can you attach the schema, the test document, and XPath expression that
>> is failing? I have not been able to reproduce from the information you
>> have provided.
>
>> Paul
>
>
>
Re: How to test an element specified in the input xml or not? [message #42010 is a reply to message #41288] Mon, 18 February 2008 12:34 Go to previous message
hamlin is currently offline hamlinFriend
Messages: 8
Registered: July 2009
Junior Member
Hi Paul,
Thanks so much for your efforts and sorry for the late response for I just
came back from our new year vacation.

I tried the new version and it does fix the NullPointerException. But I
find that the content between "<![CDATA[" and "]]>" can not be shown by
<c:dump/> if we specified the "xsi:noNamespaceSchemaLocation" attribute.
Do you have any idea for that?

I'll do further test later and keep you posted later.

B.R.
Chaohong

Paul Elder wrote:

> Thanks fro the information.

> FYI. I have committed a change that at least resolves the NPE.

> Bug, the underlying problem is you have the following code:

> <c:if test="/datasource/raw" var="ds1">
> Raw ds is <c:get select="$ds1/@uri"/>.
> </c:if>

> The fix corrects a problem where /datasource/raw was evaluating to 'true',
> and setting $ds1 to null, thus causing the follow-on problem in c:get (which
> has also been fixed).

> The fix will be included in this weeks maintenance build.

> Paul
Previous Topic:Setting string to a variable
Next Topic:model instance retrieval with ref to schema?
Goto Forum:
  


Current Time: Fri Mar 29 05:02:49 GMT 2024

Powered by FUDForum. Page generated in 0.03280 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top