Hi,
A little bit of perseverance and some playing around I have it cracked. -
<%
-
String esfXMLPath = blackboard.platform.plugin.PlugInUtil.getUri("ESFN", "Featured-Module", "FeaturedModule.xml");
-
Document doc = EsfDomParserBean.getDocument(esfXMLPath);
-
//traverseTree(doc, out);
-
Element root = doc.getDocumentElement();
-
NodeList moduleList = root.getChildNodes();
-
-
StringBuilder output = new StringBuilder("<div class=\"horizontalScroll\" id=\"horizontalScroll\" style=\"display:block;float:left;overflow:auto;overflow-x:scroll;overflow-y:hidden;height:250px\">");
-
-
for(int i = 0; i < moduleList.getLength(); i++)
-
{
-
Node module = moduleList.item(i);
-
if(module.getNodeName().equals("module"))
-
{
-
output.append("<div class=\"detailsContainer\" id=\"detailsContainer\" style=\"display:inline-block;float:left;\">");
-
Element section = (Element) moduleList.item(i);
-
String title= "<h3>" + section.getAttribute("type") + " — " + section.getAttribute("title") + "</h3>";
-
-
NodeList moduleDetails = module.getChildNodes();
-
for(int j = 0; j < moduleDetails.getLength(); j++)
-
{
-
Node moduleDetail = moduleDetails.item(j);
-
if(moduleDetail.getNodeName().equalsIgnoreCase("description"))
-
{
-
output.append("<span class=\"leftContainer\" id=\"leftContainer\" style=\"display:inline;float:left\">" + title + "<p>" + moduleDetail.getChildNodes().item(0).getNodeValue() + "</p></span>");
-
}
-
if(moduleDetail.getNodeName().equalsIgnoreCase("img"))
-
{
-
output.append("<span class=\"rightContainer\" id=\"rightContainer\" style=\"display:inline;float:right\"><img src=\"" + moduleDetail.getChildNodes().item(0).getNodeValue() + "\"/></span>");
-
}
-
}
-
output.append("</div>");
-
}
-
}
-
output.append("</div>");
-
%>
-
<%=output.toString() %>
-
I admit I need some error trapping in here - particularly to cater for NullPointerExceptions but the basics are there thanks to : http://groups.google.com/group/Googl...d9b39322?pli=1 http://www.java2s.com/Code/JavaAPI/o...tNodeValue.htm
Thanks
nathj
2 5146
Hi,
Here's a quick update on the progress I'm making. As such the question has changed slightly now. -
<%
-
String esfXMLPath = blackboard.platform.plugin.PlugInUtil.getUri("ESFN", "Featured-Module", "FeaturedModule.xml");
-
Document doc = EsfDomParserBean.getDocument(esfXMLPath);
-
//traverseTree(doc, out);
-
Element root = doc.getDocumentElement();
-
NodeList moduleList = root.getChildNodes();
-
-
StringBuilder output = new StringBuilder("<div class=\"horizontalScroll\" id=\"horizontalScroll\" style=\"display:block;float:left;overflow:auto;overflow-x:scroll;overflow-y:hidden;height:250px\">");
-
-
for(int i = 0; i < moduleList.getLength(); i++)
-
{
-
Node module = moduleList.item(i);
-
if(module.getNodeName().equals("module"))
-
{
-
output.append("<div class=\"detailsContainer\" id=\"detailsContainer\" style=\"display:inline-block;float:left;\">");
-
Element section = (Element) moduleList.item(i);
-
String title= "<h3>" + section.getAttribute("type") + " — " + section.getAttribute("title") + "</h3>";
-
-
NodeList moduleDetails = module.getChildNodes();
-
for(int j = 0; j < moduleDetails.getLength(); j++)
-
{
-
Node moduleDetail = moduleDetails.item(j);
-
if(moduleDetail.getNodeName().equalsIgnoreCase("description"))
-
{
-
output.append("<span class=\"leftContainer\" id=\"leftContainer\" style=\"display:inline;float:left\">" + title + moduleDetail.getNodeValue() + "</span>");
-
}
-
if(moduleDetail.getNodeName().equalsIgnoreCase("img"))
-
{
-
output.append("<span class=\"rightContainer\" id=\"rightContainer\" style=\"display:inline;float:right\"><img src=\"" + moduleDetail.getNodeValue() + "\"/></span>");
-
}
-
}
-
output.append("</div>");
-
}
-
}
-
output.append("</div>");
-
%>
-
<%=output.toString() %>
-
Now I'm getting the type and title out of the module element which is great. The trouble is that I now am not getting the data out of the XML, so I'm not seeing the description coming out.
Any help on this is greatly appreciated.
Cheers
nathj
Hi,
A little bit of perseverance and some playing around I have it cracked. -
<%
-
String esfXMLPath = blackboard.platform.plugin.PlugInUtil.getUri("ESFN", "Featured-Module", "FeaturedModule.xml");
-
Document doc = EsfDomParserBean.getDocument(esfXMLPath);
-
//traverseTree(doc, out);
-
Element root = doc.getDocumentElement();
-
NodeList moduleList = root.getChildNodes();
-
-
StringBuilder output = new StringBuilder("<div class=\"horizontalScroll\" id=\"horizontalScroll\" style=\"display:block;float:left;overflow:auto;overflow-x:scroll;overflow-y:hidden;height:250px\">");
-
-
for(int i = 0; i < moduleList.getLength(); i++)
-
{
-
Node module = moduleList.item(i);
-
if(module.getNodeName().equals("module"))
-
{
-
output.append("<div class=\"detailsContainer\" id=\"detailsContainer\" style=\"display:inline-block;float:left;\">");
-
Element section = (Element) moduleList.item(i);
-
String title= "<h3>" + section.getAttribute("type") + " — " + section.getAttribute("title") + "</h3>";
-
-
NodeList moduleDetails = module.getChildNodes();
-
for(int j = 0; j < moduleDetails.getLength(); j++)
-
{
-
Node moduleDetail = moduleDetails.item(j);
-
if(moduleDetail.getNodeName().equalsIgnoreCase("description"))
-
{
-
output.append("<span class=\"leftContainer\" id=\"leftContainer\" style=\"display:inline;float:left\">" + title + "<p>" + moduleDetail.getChildNodes().item(0).getNodeValue() + "</p></span>");
-
}
-
if(moduleDetail.getNodeName().equalsIgnoreCase("img"))
-
{
-
output.append("<span class=\"rightContainer\" id=\"rightContainer\" style=\"display:inline;float:right\"><img src=\"" + moduleDetail.getChildNodes().item(0).getNodeValue() + "\"/></span>");
-
}
-
}
-
output.append("</div>");
-
}
-
}
-
output.append("</div>");
-
%>
-
<%=output.toString() %>
-
I admit I need some error trapping in here - particularly to cater for NullPointerExceptions but the basics are there thanks to : http://groups.google.com/group/Googl...d9b39322?pli=1 http://www.java2s.com/Code/JavaAPI/o...tNodeValue.htm
Thanks
nathj
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mike Clair |
last post by:
Hey,
I'm having an issue with CSS, JS and the DOM. It's gonna drive me batty. I
am trying to access the properties of a layer in JS which have been
initially set in an external CSS. The problem...
|
by: Erwin S. Andreasen |
last post by:
Hi,
I have a web application where window A opens window B (same site). B
later wants to do something depending on whether
the window A, window.opener.document.domain, has changed.
However,...
|
by: Wayne Lian via .NET 247 |
last post by:
Hi all, Just wonder anyone have encountered this problem before?I tried using XMLSPY debugger and I can get the correct outputfor my XSLT transformation, however in .net, aftertransformation the...
|
by: Michael Iantosca |
last post by:
I have a custom attribute that I attach to certain pages in my application and I want to inspect each page request as it is made to see if the custom attribute is attached to the underlying page...
|
by: serge calderara |
last post by:
Dear all,
where is the place to get the list of each valid attributes for individual
Element of a confi file or Html page view?
thanks fr your help
regards
serge
|
by: joewhitehair |
last post by:
Using a schema, I created classes for my web service using the XSD.exe tool.
With the classes I then wrote a web service function, but the WSDL that is
generated has different minOccurs and...
|
by: Mikus Sleiners |
last post by:
I want to create xml document that looks like this:
<?xml version="1.0" encoding="utf-16"?>
<Draft xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
|
by: matthewjbarr |
last post by:
Sorry for cross-posting, but I posted this in the PHP group and think
it probably should have been here - think maybe I should be looking at
XPath expressions to solve the problem. E.g. something...
|
by: Beorne |
last post by:
In the classes I develop my attributes are always private and are
exposed using properties.
directly or to access the attributes using the properties?
Does "wrapper" setter/getter properties...
|
by: cloftis |
last post by:
Using VS2003, VB and MSHTML,
Using an HTMLSpanElement I want to enumerate the attributes of a SPAN
tag.
1 'For testing sake
2 Dim strMarkup as String = "<span attr1='somevalue'...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |