• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

apply- templates!!!!!!!!

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
Acc. to nutshell apply-templates changes the order of traversal.
If we want to select a certain elts we can use that.
But what exactly <apply-templates /> does?
Can anyone explain me with an example?
Thanks in advance,
Shakthy
 
Jaysakthy Muthuvelu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry i missed XSL
what exactly It represent
<xsl:apply-templates/>
thanks
 
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It means "for each child of this node, try to find and apply an appropriate matching template".
 
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess you can also look at it this way. Since the select is not explicitly mentioned, the default value will be used, which will be the child axis and hence we are in effect apply-templates to all the children of the current context node.
 
Jaysakthy Muthuvelu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the clarification!
Yet i need to work our some examples on that.
I have another problem running the Xalan processor. I extract the jar files & did the classpath settings.
Everything is perfect .
But once run i try ot run Fitness.xml file it says JRE files not found in the correct directory missing rt.jar;
But iam having my JRE file in c:/programfiles/.../rt.jar; I did set the classpath what do i have to do next.
Plz help me with these Issues i couldnt work out some examples or clear my doubts.
Thanks.
 
Jaysakthy Muthuvelu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jayadev,
In this below link u posted some solution Iam not clear could u plz explain me step by step.
I am having the same error like paula.
"Jre not installed in the correct dir"
https://coderanch.com/t/146822/po/certification/running-XSLT-program
Thanks
Shakthy
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to have your JRE/bin in the system path and the place where you have the class files in the CLASSPATH. I think if you have .jar files, you need to mention the filenames explicitly in the classpath. Just mentioning the directory where you have the jar files is not going to be sufficient.
Hope this helps.
 
Jaysakthy Muthuvelu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jayadev,
Is this correct :
c:/jdk/bin;
c:/jdk/jre1.1.3/lib/rt.jar;<!-- Java classpath)
c:/xalan/xalan/bin;c:/xalan/xalan/bin/xalan.jar;
<!-- xalan processor -->
I appreciate ur help,
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I really don't know how to interpret this message. ""Jre not installed in the correct dir"". May be someone else who faced a similar problem should be able to help you. Sorry for not being of much help.
 
Jaysakthy Muthuvelu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jayadev,
That's ok! Is there any way i can run XSLT programs?I think saxon is also based on Java.
I have some other questions!
Could u plz help me with that!
13. Which of the following XML fragments are well-formed?
a)<myElement myAttribute="value1 <= value2"/>
b)<myElement myAttribute="value1 & value2"/>
c)<myElement myAttribute="value1 > value2"/>
d)<myElement myAttribute="value1'value2"/>

Answers: c d
Well-formed XML document is not allowed to use "<" and "&" characters within an attribute value

My answer : D
What abt ">" ?
Correct me if iam wrong!

2.From skillometer.com
<!xml version="1.0">
<person>
<name>
<fname>some info</fname>
<lname>someother info</lname>
</name>
<address>info1</address>
<phone>info2</phone>
</person>
1.valid
2.valid & wellformed
3.invalid & not wellformed
4.wellformed
Up to my knowledge,The given example is wellformed.?
What if there is no DTD or schema to check the validity But the Xml doc is wellformed
Which option do i have to check there?
Thanks in advance
Shakthy.
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
">" is allowed in an attribute value. I don't know why, but it is.
An XML file cannot be "valid" if there is no DTD or schema to validate it against.
 
Jaysakthy Muthuvelu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry the first line of that program is here :
<?xml version="1.0"?>
Replace this:
I got confused with another Document.
Thanks,
Shakthy
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic