Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XSL group [modified]

XSL group [modified]

Scheduled Pinned Locked Moved XML / XSL
xmlquestioncomregexannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Clas Andersson
    wrote on last edited by
    #1

    Hi. How can I group values in "Type" ( xmldatasource - fill dropdownlist with distinct values ) ? XSL: <?xml version="1.0"?> <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msxsl="urn:schemas-microsoft-com:xslt" > <xsl:strip-space elements="*"/> <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" standalone="yes" /> <xsl:template match="/"> <xsl:for-each select="dataroot"> <xsl:element name="dataroot"> <xsl:for-each select="Table_A"> <xsl:element name="Table_A"> <xsl:attribute name="Type"> <xsl:value-of select="Type"/> </xsl:attribute> </xsl:element> </xsl:for-each> </xsl:element> </xsl:for-each> </xsl:template> </xsl:transform> XML: <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2009-10-21T09:21:31"> <Table_A> <ID_I>100085004</ID_I> <Type>GPS</Type> <Value>0</Value> <SDD_Date>1829-06-12T00:00:00</SDD_Date> </Table_A> </dataroot> Thanks in advance !!

    modified on Friday, October 23, 2009 3:43 AM

    T 1 Reply Last reply
    0
    • C Clas Andersson

      Hi. How can I group values in "Type" ( xmldatasource - fill dropdownlist with distinct values ) ? XSL: <?xml version="1.0"?> <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msxsl="urn:schemas-microsoft-com:xslt" > <xsl:strip-space elements="*"/> <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" standalone="yes" /> <xsl:template match="/"> <xsl:for-each select="dataroot"> <xsl:element name="dataroot"> <xsl:for-each select="Table_A"> <xsl:element name="Table_A"> <xsl:attribute name="Type"> <xsl:value-of select="Type"/> </xsl:attribute> </xsl:element> </xsl:for-each> </xsl:element> </xsl:for-each> </xsl:template> </xsl:transform> XML: <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" generated="2009-10-21T09:21:31"> <Table_A> <ID_I>100085004</ID_I> <Type>GPS</Type> <Value>0</Value> <SDD_Date>1829-06-12T00:00:00</SDD_Date> </Table_A> </dataroot> Thanks in advance !!

      modified on Friday, October 23, 2009 3:43 AM

      T Offline
      T Offline
      tassilo
      wrote on last edited by
      #2

      Clas, can you use XSLT 2.0 instead 1.0? (If you can control the XSLT engine you use, then switch to SAXON by M. Kaye, from the web-site, you can also download all you need for .NET reuse.) If so, and the so-called Muenchian method is your friend. All you need to know you will find here: http://www.jenitennison.com/xslt/grouping/muenchian.html[^] Best regards, Stefan

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups