[opencms-dev] [XSD, content rendering] Beginner question - I receive "??? xyz ???" when accessing xml elements
Florian Gutmann
blackfeet at gmx.at
Wed Sep 24 10:08:08 CEST 2008
cms:contentcheck should be what you are looking for.
Normally i read structured contents something like this:
<cms:contentload collector="singleFile" param="${file}" editable="true">
<cms:contentcheck ifexists="Content/Title">
<h3><cms:contentshow element="Content/ Title "/></h3>
</cms:contentcheck>
</cms:contentload>
--
Florian
-----Ursprüngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] Im Auftrag von mailinglists
Gesendet: Dienstag, 23. September 2008 19:09
An: opencms-dev at opencms.org
Betreff: [opencms-dev] [XSD, content rendering] Beginner question - I
receive "??? xyz ???" when accessing xml elements
Hi,
I'm using a schema definition for page templates which contain an
element for the body text:
<xsd:element name="BodyText" type="OpenCmsString" minOccurs="0"
maxOccurs="1" />
...
<layout element="BodyText" widget="HtmlWidget"
configuration="height:250px,link,anchor" />
I'm now creating an content item in the admin GUI and can (without
errors) use this item. When rendering the element I'm using following
code to retrieve the element:
CmsJspTagContentShow.contentShowTagAction(element, pageContext,
"BodyText", null);
If the body text is present in the content item everything works fine.
But when the body text has not been created the contentSHowTagAction
does return "??? BodyText ???".
Am I doing something wrong?
Am I completely wrong or shouldn't it return null if the element is not
present (or throw an exception)?
Any workaround to find out if the element is present instead of ugly
string matching or parsing myself?
May I hug the programmer till he/she squeezes (i guess it's part of the
xml parser) who is responsible for returning rubbish instead of null ;-)
thanks in advance,
Philip
_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list