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. XQuery / multiple conditions

XQuery / multiple conditions

Scheduled Pinned Locked Moved XML / XSL
databasexmltutorialquestionannouncement
1 Posts 1 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.
  • P Offline
    P Offline
    pedefetoll
    wrote on last edited by
    #1

    I, I am trying to use XQuery on XML data and elaborated samples are few on the web. I only find small tutorials for beginners. Here is the query specification : > it's a list of "vehicle"; > each "vehicle" has "flags" nodes; > each "vehicle" is identified by a unique numeric "id" attribute; > I want to find the lowest id verifying a list of flags ; Here is a sample of data : ?xml version="1.0" encoding="UTF-8"? vehicles    vehicle id="1"          flags             flag1/             flag2/          /flags    /vehicle    vehicle id="5"          flags             flag1/             flag2/          /flags    /vehicle /vehicles Here a sample of query on one flag : (: smallest index index :) let $d := doc( $inputDocument)//vehicle let $e := $d/flags/flag1 return min( $e/../../fn:number( @id)) How to process for several flags, with "and" and "or".... Best regards

    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