DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 10 of 10

Thread: exists() in xslt

  1. #1
    Join Date
    Apr 2008
    Posts
    14

    exists() in xslt

    hi
    i need to convert from perl coding to xslt ,

    if (exists $a{$b}{$c})

    how can i use this perl coding in xslt plz reply soon

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Does this help?

  3. #3
    Join Date
    Apr 2008
    Posts
    14

    exists()

    ok u r coding is some what help ful but i need
    how to use exists() in xslt

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Ok, I found this.

  5. #5
    Join Date
    Apr 2008
    Posts
    14
    can u give me an example of exists() in xslt

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    I just did.

  7. #7
    Join Date
    Apr 2008
    Posts
    14
    hi
    i have a doubt
    i have an xml input file ,it contains a container,in that container it contains different parameters ,from that i want to write code

    i have code in perl using xml input

    if($a!='value')
    {
    if($c=' ')
    {
    print error
    }
    if($d=' ')
    {
    print error
    }
    }

    from above code $a comes under one parameter ,it checks that parameter value is equals or not ,if condition is true it enters in to that condition and
    $c is second parameter it checks that whether the parameter value is null or not if it is null it will print error, and $d is the 3rd parameter in the same container it also checks wheter it is null r not same thing will happen,

    problem is how can i fetch the values from different parameters from the same condition,with in one condition,the values of $c and $d is not accessing from xml input

    plz reply soon

  8. #8
    Join Date
    Apr 2008
    Posts
    14
    actually i for got to tell that this above perl code should be convert in to xslt taking input from xml

    i need this output in xslt

  9. #9
    Join Date
    Apr 2008
    Posts
    14
    xml code
    <container>
    <containerarametervalues>
    <container:enum>parameter1</container:enum>
    <container:value>data<container:value>
    <container:enum>parameter2</container:enum>
    <container:value></container:value>
    <container:int>parameter3</container:int>
    <container:value>3</container:value>
    <container:boolean>parameter4</container:boolean>
    <container:value>true</container:value>
    </containerarametervalues>
    </container>

    like this it contains 4 containers with same parameters with same or different values

    perl code
    if($parameter1!='data')
    {
    if($parameter2=' ')
    {
    print error
    }
    if($parameter3='3 ')
    {
    print error
    }
    }
    now based on these codes i need in xslt
    the problem is not fetching the values properly
    i tried different methods but its not coming
    plz reply as soon as possible

  10. #10
    Join Date
    Apr 2008
    Posts
    14
    xml code
    <container>
    <containerarametervalues>
    <container:enum>parameter1</container:enum>
    <container:value>data<container:value>
    <container:enum>parameter2</container:enum>
    <container:value></container:value>
    <container:int>parameter3</container:int>
    <container:value>3</container:value>
    <container:boolean>parameter4</container:boolean>
    <container:value>true</container:value>
    </containerarametervalues>
    </container>

    like this it contains 4 containers with same parameters with same or different values

    perl code
    if($parameter1!='data')
    {
    if($parameter2=' ')
    {
    print error
    }
    if($parameter3='3 ')
    {
    print error
    }
    }
    now based on these codes i need in xslt
    the problem is not fetching the values properly
    i tried different methods but its not coming
    plz reply as soon as possible

Similar Threads

  1. Replies: 2
    Last Post: 05-04-2002, 02:50 AM
  2. Importing xslt into 1 master xslt then to html
    By Patrick Long in forum XML
    Replies: 1
    Last Post: 03-01-2002, 03:47 PM
  3. A question about EXISTS
    By Richard Hart in forum Database
    Replies: 6
    Last Post: 01-09-2002, 02:50 PM
  4. Replies: 0
    Last Post: 06-21-2001, 05:33 PM
  5. Multiple stylesheets with XSLT
    By Mark in forum XML
    Replies: 0
    Last Post: 04-10-2001, 05:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center