Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

xml filter

Posted on 2006-06-26
3
Medium Priority
?
249 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
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 80 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
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…
Introduction to Processes

824 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