<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="2" face="Trebuchet MS">xmlContent.getValue("/</font><font
size="2" face="Trebuchet MS">Column1Name</font><font size="2"
face="Trebuchet MS">[1]/Column1/Link", enLocale,
0).getStringValue(cmso);</font><font size="3">
</font>
<br>
<br>
should give you the first link however in this case you better use
something like:<br>
<br>
<tt>List<I_CmsXmlContentValue> columns= <font size="2">xmlContent</font>.getValues("Comment",
Locale.GERMAN);<br>
<br>
for (int i = columns.size() - 1; i >= 0; i--)<br>
{<br>
I_CmsXmlContentValue column = columns.get(i);<br>
String nvalue = column .getDocument().getStringValue(cms,
CmsFileUtil.addTrailingSeparator(column .getPath()) + "<font
size="2">Column1/Link</font>",<font size="2"> enLocale</font>);<br>
}</tt><br>
<br>
On 29.06.2011 17:42, Raghu D wrote:
<blockquote
cite="mid:OF5D0D2094.C6BB18C9-ON652578BE.0055C8E6-652578BE.00564B67@ibsplc.com"
type="cite"><font size="2" face="Trebuchet MS">Hi Fabian,</font>
<br>
<br>
<font size="2" face="Trebuchet MS"> The
value i am trying to get seems to be wrong.The xml looks like</font>
<br>
<br>
<font size="2" face="Trebuchet MS"><Column1Name><![CDATA[Promotions]]></Column1Name></font>
<br>
<font size="2" face="Trebuchet MS"> <Column1SummaryPage/></font>
<br>
<font size="2" face="Trebuchet MS"> <Column1></font>
<br>
<font size="2" face="Trebuchet MS">
<Text><![CDATA[SAA
specials]]></Text></font>
<br>
<font size="2" face="Trebuchet MS"> <Link></font>
<br>
<font size="2" face="Trebuchet MS"> <link
internal="true" type="WEAK"></font>
<br>
<font size="2" face="Trebuchet MS">
<target><![CDATA[/sites/default/specials/specials.html]]></target></font>
<br>
<font size="2" face="Trebuchet MS">
<uuid>47c7ea0b-f083-11df-b97c-07b4bbf14345</uuid></font>
<br>
<font size="2" face="Trebuchet MS"> </link></font>
<br>
<font size="2" face="Trebuchet MS"> </Link></font>
<br>
<font size="2" face="Trebuchet MS"> </Column1></font>
<br>
<font size="2" face="Trebuchet MS"><Column1Name><![CDATA[hotels]]></Column1Name></font>
<br>
<font size="2" face="Trebuchet MS"> <Column1SummaryPage/></font>
<br>
<font size="2" face="Trebuchet MS"> <Column1></font>
<br>
<font size="2" face="Trebuchet MS">
<Text><![CDATA[SAA
specials]]></Text></font>
<br>
<font size="2" face="Trebuchet MS"> <Link></font>
<br>
<font size="2" face="Trebuchet MS"> <link
internal="true" type="WEAK"></font>
<br>
<font size="2" face="Trebuchet MS">
<target><![CDATA[/sites/default/hotels/taj.html]]></target></font>
<br>
<font size="2" face="Trebuchet MS">
<uuid>47c7ea0b-f083-11df-b97c-07b4bbf14345</uuid></font>
<br>
<font size="2" face="Trebuchet MS"> </link></font>
<br>
<font size="2" face="Trebuchet MS"> </Link></font>
<br>
<font size="2" face="Trebuchet MS"> </Column1></font>
<br>
<br>
<font size="2" face="Trebuchet MS"> From
the above one , i need to get the value
<target><![CDATA[/sites/default/specials/specials.html]]></target>
.
Could you advise me on how to get the value.</font>
<br>
<br>
<font size="2" face="Trebuchet MS">Thanks and Regards,<br>
</font>
<table>
<tbody>
<tr>
<td><font size="2" color="#5f5f5f" face="Trebuchet MS">Raghu
D.</font>
</td>
</tr>
<tr>
<td>
<br>
</td>
</tr>
<tr valign="top">
<td><br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<br>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">From:
</font><font size="1" face="sans-serif">Raghu D/IBS</font>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">To:
</font><font size="1" face="sans-serif">Fabian Huschka
<a class="moz-txt-link-rfc2396E" href="mailto:fhsubscriptions@componio.net"><fhsubscriptions@componio.net></a></font>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">Date:
</font><font size="1" face="sans-serif">06/29/2011 07:17 PM</font>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">Subject:
</font><font size="1" face="sans-serif">Re: [opencms-dev]
<cms:contentshow element="Link"/></font>
<br>
<hr noshade="noshade">
<br>
<br>
<font size="2" face="Trebuchet MS">Hi Fabian ,</font>
<br>
<br>
<font size="2" face="Trebuchet MS"> Thanks
for the advise.Now the IndexOutofBounds exception is solved .
But i am
getting the Null pointer exception @ </font>
<br>
<font size="2" face="Trebuchet MS">String message =
xmlContent.getValue("Link",
enLocale, 0).getStringValue(cmso); </font>
<br>
<br>
<font size="2" face="Trebuchet MS">Could you advise whether the
value
i am trying to get not exist or due to some other reason.</font>
<br>
<br>
<font size="2" face="Trebuchet MS"> Regards,<br>
Raghu D</font>
<table>
<tbody>
<tr>
<td>
<br>
</td>
</tr>
<tr>
<td>
<br>
</td>
</tr>
<tr valign="top">
<td><br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">From:
</font><font size="1" face="sans-serif">Fabian Huschka
<a class="moz-txt-link-rfc2396E" href="mailto:fhsubscriptions@componio.net"><fhsubscriptions@componio.net></a></font>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">To:
</font><font size="1" face="sans-serif">The OpenCms mailing
list <a class="moz-txt-link-rfc2396E" href="mailto:opencms-dev@opencms.org"><opencms-dev@opencms.org></a></font>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">Cc:
</font><font size="1" face="sans-serif">Raghu D
<a class="moz-txt-link-rfc2396E" href="mailto:Raghu.Devaraj@ibsplc.com"><Raghu.Devaraj@ibsplc.com></a></font>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">Date:
</font><font size="1" face="sans-serif">06/29/2011 06:57 PM</font>
<br>
<font size="1" color="#5f5f5f" face="sans-serif">Subject:
</font><font size="1" face="sans-serif">Re: [opencms-dev]
<cms:contentshow element="Link"/></font>
<br>
<hr noshade="noshade">
<br>
<br>
<br>
<font size="3">Hi, <br>
<br>
please use the filetranslator or <br>
</font><font size="2" face="Trebuchet MS"><br>
String uri = cms.getRequestContext().getUri(); <br>
String tempUri= </font><font size="3">cms.getRequestContext().removeSiteRoot(uri);<br>
<br>
to get rid of a potential site root. In your case there is
surely no "/sites/default"
in the URI thus the IndexOutOfBounds exception as you try to
access the
second element which does not exist. <br>
The rest of the code looks ok. <br>
<br>
\Fabian<br>
<br>
<br>
<br>
On 29.06.2011 15:11, Raghu D wrote: </font>
<br>
<font size="2" face="Trebuchet MS">CmsJspActionElement cms = new
CmsJspActionElement
(pageContext, request, response);</font><font size="3"> </font><font
size="2" face="Trebuchet MS"><br>
CmsObject cmso = cms.getCmsObject();</font><font size="3"> </font><font
size="2" face="Trebuchet MS"><br>
String uri = cms.getRequestContext().getUri(); <br>
String tempUri= uri.split("/sites/default")[1] ; <br>
CmsFile file = cmso.readFile(tempUri) ;</font><font size="3">
</font><font size="2" face="Trebuchet MS"><br>
CmsXmlContent xmlContent =
CmsXmlContentFactory.unmarshal(cmso,file);</font><font size="3">
</font><font size="2" face="Trebuchet MS"><br>
String message = xmlContent.getValue("Link", enLocale,
0).getStringValue(cmso);</font><font size="3">
</font>
<br>
<br>
<font size="2" face="sans-serif"><br>
</font>
<br>
<font size="2" face="sans-serif"><br>
<br>
<br>
<br>
DISCLAIMER:</font><font size="3"> </font><font size="1"
color="#a2a2a2" face="Tahoma"><br>
<br>
"The information in this e-mail and any attachment is intended
only
for the person to whom it is addressed and may contain
confidential and/or
privileged material. If you have received this e-mail in error,
kindly
contact the sender and destroy all copies of the original
communication.
IBS makes no warranty, express or implied, nor guarantees the
accuracy,
adequacy or completeness of the information contained in this
email or
any attachment and is not liable for any errors, defects,
omissions, viruses
or for resultant loss or damage, if any, direct or indirect."</font><font
size="3"><br>
</font><font size="1"><br>
</font><font size="3"><br>
</font>
<br>
<br>
<font size="2" face="sans-serif"><br>
</font>
<br>
<font size="2" face="sans-serif"><br>
<br>
<br>
<br>
DISCLAIMER:</font><font size="3"> </font><font size="1"
color="#a2a2a2" face="Tahoma"><br>
<br>
"The information in this e-mail and any attachment is intended
only
for the person to whom it is addressed and may contain
confidential and/or
privileged material. If you have received this e-mail in error,
kindly
contact the sender and destroy all copies of the original
communication.
IBS makes no warranty, express or implied, nor guarantees the
accuracy,
adequacy or completeness of the information contained in this
email or
any attachment and is not liable for any errors, defects,
omissions, viruses
or for resultant loss or damage, if any, direct or indirect."</font><font
size="3"><br>
</font><font size="1"><br>
</font><font size="3"><br>
</font>
<br>
<br>
</blockquote>
<br>
</body>
</html>