Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: XML XHTML XSL
I am working on a simple project which should allow me to create html input controls with data
defined in an xml file through xslt.
 
This is my xm data..
 
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="robust_xsl.xsl"?>
<template>
	<dividers>
		<divider><name> metadata </name></divider>
		<divider><name> themes </name></divider>
		<divider><name> pages </name></divider>
		<divider><name> plugins </name></divider>
	</dividers>	
  
	<metadata>
		<metaName object="entry" name="name" type="text" id="txtName" value=""></metaName>
		<metaDescription object="entry" name="description" type="textarea" id="txtDescription" value=""></metaDescription>
		<metaVersion object="entry" name="version" type="text" id="txtName" value="" otherAttributes="style=width:20px;"></metaVersion>
	</metadata>
 
	<themes>
		<theme> </theme>
	</themes>
  
</template>
 
 

and the xslt for this code is
...............................
 
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="template">
  <html>
	<body>
	<h2>Template Information Collection form </h2>
		<xsl:for-each select="dividers/divider">
			<fieldset>
				<legend> <xsl:value-of select="name"/> </legend>
				<xsl:for-each select="name">
					
				</xsl:for-each>
			</fieldset>
			<hr/>
		</xsl:for-each>
	</body>
  </html>
</xsl:template>
 
</xsl:stylesheet>
 

THE biggest problem i have is i want to navigate through the list of the dividers specified and be able to select each divider entry, search through the xml document for the existence of that node name then process data inside it different...
 
This is what i mean..
if my divider name = "metadata" i should go to the <metadata> .... </metadata> and collect data between this tag then go to the next divider ...
 
I have tried to search the best way to do this but cant get a good approach...have seen using variables but encountered a challenge of modifying the value of that variable.
 
Please help.
Thanks
Posted 22-Feb-13 3:50am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 304
1 Sergey Alexandrovich Kryukov 255
2 Shweta N Mishra 216
3 Maciej Los 210
4 PIEBALDconsult 184
0 OriginalGriff 7,630
1 Sergey Alexandrovich Kryukov 7,022
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,525


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100