Click here to Skip to main content
15,509,322 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: reconfirm Pin
Chandrasekharan P9-Apr-12 22:02
Chandrasekharan P9-Apr-12 22:02 
Questionxml data will not display on the screen on a php page Pin
awolarczuk1-Mar-12 1:05
awolarczuk1-Mar-12 1:05 
Questiongenerating html tree from xml file using xslt. Pin
anikbutt2210-Feb-12 2:41
anikbutt2210-Feb-12 2:41 
QuestionHow to open zipfile and xls Pin
Themba Zwane8-Feb-12 8:53
Themba Zwane8-Feb-12 8:53 
AnswerRe: How to open zipfile and xls Pin
Richard MacCutchan8-Feb-12 22:54
mveRichard MacCutchan8-Feb-12 22:54 
AnswerRe: How to open zipfile and xls Pin
ZurdoDev19-Mar-12 10:02
professionalZurdoDev19-Mar-12 10:02 
QuestionImplementing Apriori Algorithm with XQuery Pin
helloworld202018-Jan-12 2:47
helloworld202018-Jan-12 2:47 
Questionsplitting the xmlnode based on nodelength Pin
harinit11-Jan-12 23:20
harinit11-Jan-12 23:20 
Hi,

My Sample XML is as follows:

<Students>
  <Student>
    <roll id="1" />
    <StudName id="stud1" />
    <Class1 val="cls1" />
    <Class2 val="cls2" />
    <Class3 val="cls3" />
    <Class4 val="cls4" />
    <Class5 val="cls5" />
    <Class6 val="cls6" />
  </Student>
  <Student>
    <roll id="2" />
    <StudName id="stud2"/>
    <Class1 val="cls7" />
    <Class2 val="cls8" />
    <Class3 val="cls9" />
    <Class4 val="cls10" />
    <Class5 val="cls11" />
    <Class6 val="cls12" />
    </Student>
  <Student>
    <roll id="3" />
    <StudName id="stud3" />
    <Class1 val="cls13" />
    <Class2 val="cls14" />
    <Class3 val="cls15" />
    <Class4 val="cls16" />
    <Class5 val="cls17" />
    <Class6 val="cls18" />
    </Student>
  <Student>
    <roll id="4" />
    <StudName id="stud4" />
    <Class1 val="cls19" />
    <Class2 val="cls20" />
    <Class3 val="cls21" />
    <Class4 val="cls22" />
    <Class5 val="cls23" />
    <Class6 val="cls24" />
   </Student>
  <Student>
    <roll id="5" />
    <StudName id="stud5" />
    <Class1 val="cls25" />
    <Class2 val="cls26" />
    <Class3 val="cls27" />
    <Class4 val="cls28" />
    <Class5 val="cls29" />
    <Class6 val="cls30" />
   </Student>
</Students>

Now i need to prepare XSLT such that if nodes are more than 3 then i need to get only roll and studname nodes.

I need to get the result as

<Students>
  <Student>
    <roll id="1" />
    <StudName id="stud1" />    
  </Student>
  <Student>
    <roll id="2" />
    <StudName id="stud2"/>    
    </Student>
  <Student>
    <roll id="3" />
    <StudName id="stud3" />
    </Student>
  <Student>
    <roll id="4" />
    <StudName id="stud4" />
   </Student>
  <Student>
    <roll id="5" />
    <StudName id="stud5" />
   </Student>
</Students>


Please provide me the required XSLT such that i need to get the above output...
Thanks in advance

Harini
AnswerRe: splitting the xmlnode based on nodelength Pin
chriselst13-Jan-12 1:48
chriselst13-Jan-12 1:48 
GeneralRe: splitting the xmlnode based on nodelength Pin
harinit16-Jan-12 23:37
harinit16-Jan-12 23:37 
AnswerRe: splitting the xmlnode based on nodelength Pin
woopsydoozy16-Mar-12 8:59
woopsydoozy16-Mar-12 8:59 
QuestionVStudio and xsd.exe create different schema Pin
Tomerland4-Jan-12 11:22
Tomerland4-Jan-12 11:22 
Questionhow to look for a VALUE in an xml document. Not a node. Pin
dotolee12-Dec-11 8:22
dotolee12-Dec-11 8:22 
AnswerRe: how to look for a VALUE in an xml document. Not a node. Pin
Tarun.K.S12-Dec-11 19:10
Tarun.K.S12-Dec-11 19:10 
AnswerRe: how to look for a VALUE in an xml document. Not a node. Pin
Member 86251126-Mar-12 23:40
Member 86251126-Mar-12 23:40 
QuestionHow to load xml questions into jquery flipcard? Pin
burakmartonalti14-Nov-11 20:16
burakmartonalti14-Nov-11 20:16 
QuestionXslt Transformation Pin
tellaston134527-Oct-11 7:03
tellaston134527-Oct-11 7:03 
QuestionException: "XsltContext is needed for this query because of an unknown function" Pin
NarVish20-Oct-11 23:57
NarVish20-Oct-11 23:57 
AnswerRe: Exception: "XsltContext is needed for this query because of an unknown function" Pin
NarVish21-Oct-11 1:49
NarVish21-Oct-11 1:49 
QuestionXPath problem with % value Pin
NarVish18-Oct-11 1:29
NarVish18-Oct-11 1:29 
AnswerRe: XPath problem with % value Pin
jschell18-Oct-11 9:52
jschell18-Oct-11 9:52 
GeneralRe: XPath problem with % value Pin
NarVish18-Oct-11 19:39
NarVish18-Oct-11 19:39 
GeneralRe: XPath problem with % value Pin
NarVish18-Oct-11 23:00
NarVish18-Oct-11 23:00 
GeneralRe: XPath problem with % value Pin
NarVish18-Oct-11 23:36
NarVish18-Oct-11 23:36 
QuestionHow can I put condition Pin
Noor201118-Sep-11 5:23
Noor201118-Sep-11 5:23 

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.