Click here to Skip to main content
15,910,083 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: Getting maximum id Pin
henningbenk16-Feb-08 2:30
professionalhenningbenk16-Feb-08 2:30 
QuestionXML Schema to XML File Pin
That's Aragon14-Feb-08 18:19
That's Aragon14-Feb-08 18:19 
GeneralRe: XML Schema to XML File Pin
led mike15-Feb-08 4:39
led mike15-Feb-08 4:39 
GeneralRe: XML Schema to XML File Pin
That's Aragon17-Feb-08 17:52
That's Aragon17-Feb-08 17:52 
QuestionDataSet to XML & from XML to Databse Pin
LAYEEQ AHMED KHAN13-Feb-08 19:04
LAYEEQ AHMED KHAN13-Feb-08 19:04 
GeneralRe: DataSet to XML & from XML to Databse Pin
led mike14-Feb-08 5:28
led mike14-Feb-08 5:28 
GeneralRe: DataSet to XML & from XML to Databse Pin
#realJSOP15-Feb-08 5:17
professional#realJSOP15-Feb-08 5:17 
GeneralAssistance Required Pin
rajanponnalagu13-Feb-08 6:20
rajanponnalagu13-Feb-08 6:20 
Hello,

I have one .xsl file. It is used to rendered the data from XML and displaying in HTML format. I want to do editing functionlities(add, edit,modify& delete) in a table.Like there is some default values has been displayed. I need to modify the data. Please help me, it is very urgent for me.

Thanks in advance.

The code is like this:


<xsl:template match="row">
<tr style="background-color:#E8E8E8">
<xsl:for-each select="td">
<xsl:choose>
<xsl:when test="./@first">
<td align="left" width="20px"><input name="radio_field" type="checkbox" style="border-color:white;background-color:#E8E8E8;cursor:pointer" onClick="provideAccess();changeBackcolor(this);">
<xsl:attribute name="id"><xsl:value-of select="attribute::name"/></xsl:attribute>
</input></td>
</xsl:when>
<xsl:when test="@last='true'">
<td align="left" width="10px" ><xsl:value-of select="./text()"/></td>
</xsl:when>

<xsl:when test="@editable" ='true' ">
<td align="left" width="20px"><input name="textbox" type="text" style="border-color:white;background-color:#E8E8E8;cursor:pointer" onClick="provideAccess();changeBackcolor(this);">
<xsl:attribute name="id"><xsl:value-of select="attribute::name"/></xsl:attribute>
</input></td>
</xsl:when>


<xsl:otherwise>
<td align="left">
<xsl:choose>
<xsl:when test="position()=last()">
<xsl:attribute name="width">100%</xsl:attribute>
&#160;&#160;<xsl:value-of select="./text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="pos" select="position()"/>
<xsl:attribute name="width"><xsl:value-of select="//th[position()=$pos]/@w"/>px</xsl:attribute>
&#160;&#160;<xsl:value-of select="./text()"/>
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:otherwise>
</xsl:choose>

</xsl:for-each>
</tr>

</xsl:template>

<xsl:template match="tf">
<input style="font-weight:bold; cursor:pointer; color: #0b3378" >
<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
<xsl:attribute name="onClick"><xsl:value-of select="@onclick"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="text()"/></xsl:attribute>
</input>
</xsl:template>

</xsl:stylesheet>

<!--
REPRODUCE THE BELOW CONTENTS IN INDIVIDUAL FILES UNDER BODY TAG OF A HTML FILE

<body>
<div id='tableSrc'></div>
<script>
//CONSTRUCT INPUT XML FOR TABLE FROM NE VALUES
inputXML="<tableDfn><caption>Table Heading</caption>";
inputXML+="<tHead>";
inputXML+="<th id='1' w='100' sort='true' order='ascending'>Head1</th>";
inputXML+="<th id='2' w='120' editable='true' type ='text'>Head2</th>";
inputXML+="<th id='3' w='120'>Head3</th>";
inputXML+="<th id='4' w='320'>Head4</th>";
inputXML+="<th id='5' w='120'>Head5</th>";
inputXML+="</tHead>";
inputXML+="<tBody>";
inputXML+="<row><td>one1</td><td>two1</td><td>three1</td><td>four1</td><td>five1</td></row>";
inputXML+="<row><td>one2</td><td>two2</td><td>three2</td><td>four2</td><td>five2</td></row>";
inputXML+="<row><td>one3</td><td>two3</td><td>three3</td><td>four3</td><td>five3</td></row>";
inputXML+="<row><td>one4</td><td>two4</td><td>three4</td><td>four4</td><td>five4</td></row>";
inputXML+="<row><td>one5</td><td>two5</td><td>three5</td><td>four5</td><td>five5</td></row>";
inputXML+="</tBody>";
inputXML+="<tFoot><tf type='button' onclick='alert(&quot;add&quot;)'>add</tf><tf type='button' onclick='alert(&quot;close&quot;)'>close</tf></tFoot>";
inputXML+="</tableDfn>";

// INITITIALIZAION OF XML DOM OBJECTS
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
var xslDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.setProperty('SelectionLanguage', 'XPath');
xmlDoc.loadXML(inputXML);
xslDoc.async = false;
xslDoc.load("../common/xsl/table.xsl");
newhtml = xmlDoc.transformNode(xslDoc);
document.getElementById('tableSrc').innerHTML=newhtml;

// TO SORT TABLE CONTENTS
function sortTable(node)
{
var prevNode = xmlDoc.selectSingleNode(".//tableDfn/tHead/th[@sort='true']");
if (prevNode !=null){
var curNode = xmlDoc.selectSingleNode(".//tableDfn/tHead/th[position()="+node.id+"]");
if (curNode.getAttribute('id')==prevNode.getAttribute('id'))
{
if (prevNode.getAttribute('order')=='ascending')
curNode.setAttribute("order",'descending');
else
curNode.setAttribute("order",'ascending');
}
else{
curNode.setAttribute("order",'ascending');
prevNode.removeAttribute("sort");
prevNode.removeAttribute("order");
}}
else
curNode.setAttribute("order",'ascending');
curNode.setAttribute("sort","true");
var newhtml = xmlDoc.transformNode(xslDoc);
document.getElementById('tableSrc').innerHTML=newhtml;
}

</script>

</body>
--><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="no" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\..\..\..\..\vjn\LUCENT CIT Project\Working\1830_Local\web\table" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/><scenario default="yes" name="Scenario2" userelativepaths="yes" externalpreview="no" url="..\inputXML.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->
GeneralHas Anyone ever worked on Veda Advantage? Need Some help. Pin
Gandalf_TheWhite11-Feb-08 19:45
professionalGandalf_TheWhite11-Feb-08 19:45 
GeneralRe: Has Anyone ever worked on Veda Advantage? Need Some help. Pin
led mike12-Feb-08 5:07
led mike12-Feb-08 5:07 
GeneralRe: Has Anyone ever worked on Veda Advantage? Need Some help. Pin
Gandalf_TheWhite12-Feb-08 18:34
professionalGandalf_TheWhite12-Feb-08 18:34 
GeneralRe: Has Anyone ever worked on Veda Advantage? Need Some help. Pin
led mike13-Feb-08 6:55
led mike13-Feb-08 6:55 
GeneralRe: Has Anyone ever worked on Veda Advantage? Need Some help. Pin
Gandalf_TheWhite13-Feb-08 18:48
professionalGandalf_TheWhite13-Feb-08 18:48 
GeneralRe: Has Anyone ever worked on Veda Advantage? Need Some help. Pin
led mike14-Feb-08 9:16
led mike14-Feb-08 9:16 
GeneralRe: Has Anyone ever worked on Veda Advantage? Need Some help. Pin
Gandalf_TheWhite14-Feb-08 18:09
professionalGandalf_TheWhite14-Feb-08 18:09 
QuestionHexaDecimal Error in XML Files Pin
danasegaranea10-Feb-08 18:20
danasegaranea10-Feb-08 18:20 
QuestionConverting XML Elements to Strings Pin
BugMeNot ACCOUNT8-Feb-08 14:09
BugMeNot ACCOUNT8-Feb-08 14:09 
QuestionConverting XML Elements to Strings Pin
BugMeNot ACCOUNT8-Feb-08 14:07
BugMeNot ACCOUNT8-Feb-08 14:07 
GeneralRe: Converting XML Elements to Strings Pin
pmarfleet10-Feb-08 7:17
pmarfleet10-Feb-08 7:17 
GeneralRe: Converting XML Elements to Strings Pin
Joachim Kerschbaumer11-Feb-08 21:44
Joachim Kerschbaumer11-Feb-08 21:44 
QuestionHow many nodes start slowing performance? Pin
Richard Blythe8-Feb-08 5:27
Richard Blythe8-Feb-08 5:27 
AnswerRe: How many nodes start slowing performance? Pin
led mike8-Feb-08 6:55
led mike8-Feb-08 6:55 
Generalworldofwarcraft Pin
love_man0016-Feb-08 3:03
love_man0016-Feb-08 3:03 
GeneralRe: worldofwarcraft Pin
Paul Conrad22-Mar-08 16:37
professionalPaul Conrad22-Mar-08 16:37 
Generalfiltering lookup in sharepoint Pin
ptvce3-Feb-08 20:51
ptvce3-Feb-08 20:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.