Solved

xml filter

Posted on 2006-06-26
3
242 Views
Last Modified: 2011-09-20
Hi Experts

 i am new to xml, i am writing the xquery in my project.
this is the one i am using
let $nTitlePath1 := doc(concat( $nFOLDER,"TITLES.xcs"))/TABLES/TITLES/TITLE[@TITLETYPEID =$nTITLETYPEID and @COURSEVERSIONID=$nCOURSEVERSIONID and @TOPIC = "if($nCHAPTERSONLY  = 0) then (@TOPIC) else ($nCHAPTERSONLY)"  and @SUBTOPIC = "if($nCHAPTERSONLY  =  0) then (@SUBTOPIC) else ($nCHAPTERSONLY)"   and @MICROTOPIC ="if($nCHAPTERSONLY  =  0) then (@MICROTOPIC) else ($nCHAPTERSONLY)" ]

here  nCHAPTERSONLY=0,  nCOURSEVERSIONID  = 38
this is returning the empty <ROWS>

can i assign the filte likt this   @TOPIC = "if($nCHAPTERSONLY  = 0) then (@TOPIC) else ($nCHAPTERSONLY)"

this is not returning any value
when i use @TOPIC = @TOPIC it is returning all the values int he file.

please give me the suggestion on this


thanks in adv


regards
karunakar
0
Comment
Question by:karunakarrreddy
3 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 20 total points
ID: 16983185
> when i use @TOPIC = @TOPIC it is returning all the values int he file.
of course because the test is always true

> can i assign the filte likt this   @TOPIC = "if($nCHAPTERSONLY  = 0) then (@TOPIC) else ($nCHAPTERSONLY)"
it is not really assign, it is a compare, but you can do it that way

if $nCHAPTERSONLY  = 0 it should be true
note that XQuery is strongly typed and doesn't do autocasting...
you might need if($nCHAPTERSONLY  = xs:string( 0) )

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
triangle challenge 4 117
python sqlite question 11 46
White board coding practice 3 77
Counting documents in a Domino View 3 60
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This article will show, step by step, how to integrate R code into a R Sweave document
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now