Jump to content

gianght

Members
  • Posts

    6
  • Joined

  • Last visited

gianght's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. gianght

    Nested for-each?

    "The inner for-each will then be applied to the target of the outer for-each"Great! Reg Edit is right.But if you write:<xsl:for-each select="document/box">...<xsl:for-each select="surpriselist"><xsl:value-of select ="surpriseitem"></xsl:for-each>..It only returns the first surpriseitem in the surpriselist.You should write:<xsl:for-each select="document/box">...<xsl:for-each select="surpriselist/surpriseitem"><xsl:value-of select ="."></xsl:for-each>..With each surpriseitem, select the current value (in Xpath syntax it is "." )Or if you have more than one surpricelist, you can list the surpriceitem and use a blank line to seperate each surpricelist as follow:<xsl:for-each select="document/box">...<xsl:for-each select="surpriselist"><xsl:for-each select="surpriseitem"><xsl:value-of select ="."><br/></xsl:for-each><br/></xsl:for-each>..Try it on! You will have what u want
  2. Ahhh It works!Now I can understand why it didn't work. I have only copied from the tutorial and save in the same folder. I have edited nothing. An xml file when it was viewed in IE, it changed color and added bullets or the mark like "-" before each CD. And I have copied from the IE view of these files and have edited nothing. => it didn't workI have deleted all these marks and now it works. Thanks boen_robot! I will be more careful the next time.
  3. Yes, it works with the link in the tutorial. When I create the file .xml and file .xsl I only copy from the tutorial and save with the same name, store in one folder. That's why I don't understand when it doesn't work.
  4. Hello,I has created 2 files: "cdcatalog.xsl" and "cdcatalog.xml" with reference to file xsl like in tutorial. When I opened file xml with IE, I didn't have the result like in tutorial but only error message:La page XML ne peut pas être affichée Impossible d'afficher l'entrée XML en utilisant la feuille de style XSL. Corrigez l'erreur, puis cliquez sur le bouton Actualiser ou réessayez ultérieurement. --------------------------------------------------------------------------------Non valide au niveau supérieur du document. Erreur de traitement de la ressource file:///E:/TestXML/cdcatalog.xml. Ligne 2... <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>I am now using WinXP version family. In tutorial, it said that IE6 and WinXP support XSLT. I don't know why I can't have the result as I want. Please help me understand it. Thanks
  5. Hello,In the tutorial Xquery from W3Schools, I can learn the syntax of XQuery. But I don't know how to run a XQuery (put XQuery expression in HTML file, does it?)I want to test a XQuery (run and view the results). Please help me!Thanks so much!G
×
×
  • Create New...