Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 6th, 2010, 05:27 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

No, that's not going to work when you have the uitleg's as text inside the ifelse stuff.

That's why you need to go to something like I wrote in post #2 in this thread for them.

Again, the big question: *DO* you ever have *nested* <ifelse> blocks???

That is, would you ever have something like this:
Code:
<wizard wizardid="Workflow1">
    <uitleg id="Uitleg2">Uitleg</uitleg>
    <uitleg id="Uitleg1">Uitleg</uitleg>
    <ifelse id="IfElseActivity1">
        IfElseActivity
        <ifelsebranch id="IfElseBranchActivity1">
            IfElseBranchActivity
            <uitleg id="Uitleg3">Uitleg</uitleg>
            <ifelse id="NestedIfElse1">
                <ifelsebranch id="NestedIEBa">
                    nested if else branch a
                    <uitleg id="xxx">stuff</uitleg>
                </ifelsebranch>
                <ifelsebranch id="NestedIEBb">
                    nested if else branch b
                    <uitleg id="yyy">stuff</uitleg>
                </ifelsebranch>
            </ifelse>
        </ifelsebranch>
        <ifelsebranch id="IfElseBranchActivity2">
            IfElseBranchActivity
            <uitleg id="Uitleg4">Uitleg</uitleg>
        </ifelsebranch>
    </ifelse>
</wizard>
If not, I'd keep it pretty simple and avoid using recursion. If so, you have to be more careful.
 
Old April 7th, 2010, 01:31 AM
Authorized User
 
Join Date: Feb 2010
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Yes

Quote:
Originally Posted by Old Pedant View Post
No, that's not going to work when you have the uitleg's as text inside the ifelse stuff.

That's why you need to go to something like I wrote in post #2 in this thread for them.

Again, the big question: *DO* you ever have *nested* <ifelse> blocks???

That is, would you ever have something like this:
Code:
<wizard wizardid="Workflow1">
    <uitleg id="Uitleg2">Uitleg</uitleg>
    <uitleg id="Uitleg1">Uitleg</uitleg>
    <ifelse id="IfElseActivity1">
        IfElseActivity
        <ifelsebranch id="IfElseBranchActivity1">
            IfElseBranchActivity
            <uitleg id="Uitleg3">Uitleg</uitleg>
            <ifelse id="NestedIfElse1">
                <ifelsebranch id="NestedIEBa">
                    nested if else branch a
                    <uitleg id="xxx">stuff</uitleg>
                </ifelsebranch>
                <ifelsebranch id="NestedIEBb">
                    nested if else branch b
                    <uitleg id="yyy">stuff</uitleg>
                </ifelsebranch>
            </ifelse>
        </ifelsebranch>
        <ifelsebranch id="IfElseBranchActivity2">
            IfElseBranchActivity
            <uitleg id="Uitleg4">Uitleg</uitleg>
        </ifelsebranch>
    </ifelse>
</wizard>
If not, I'd keep it pretty simple and avoid using recursion. If so, you have to be more careful.
Indeed, I do have nested ifelse
 
Old April 8th, 2010, 09:10 AM
Authorized User
 
Join Date: Feb 2010
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Changed the xml

Ok, I changed the xml file like in your example (took me some time ).
Now I try to process the xml but I don't get it. At this moment I just try to read the xml and write it to the page.

I try to achieve the following result:
Code:
<uitleg>
Uitleg2
Uitleg
</uitleg>
and so on...
This is just text written to the page. But I can't find out how to read the end tag "</uitleg>"
 
Old April 8th, 2010, 09:33 AM
Authorized User
 
Join Date: Feb 2010
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Old Pedant View Post
Why not simply do something like this:
Code:
 
Sub ProcessOneLevel( ... whatever the arguments? ... )
    Dim  : ReDim textList(0)
 
    select case actionType
        case "Uitleg"
            ReDim Preserve textList(UBound(textList)+1)
            textList(UBound(textList) = ... remember this formfield ...
      case "IfElseActivity"
            Do create dropdownbox
      case "IfElseBranchActivity"
            Do create option in dropdownbox
      case "</IfElseActivity"  
            generate the </select>
            For i = 1 To UBound(textList) 
                Create a text box from textList(i)
            Next
    end select
 
End Sub
???

By putting the textList in the sub and making it a local variable, you can even handle nesting, base on other tags.

If a one-dimensional array is too simplistic, make it a 2D array. Or a 1D array of instances of a VBS class.
Meanwhile, try to figure this out. But what is textList filled with?
 
Old April 11th, 2010, 03:40 AM
Authorized User
 
Join Date: Feb 2010
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Please

Can someone please help me out?
 
Old April 17th, 2010, 02:27 AM
Authorized User
 
Join Date: Feb 2010
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Help

I tried a few thing but can't figure it out. Can someone put me in a direction?
 
Old April 21st, 2010, 08:07 AM
Authorized User
 
Join Date: Feb 2010
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Help

Is there anybody out there to help me out?

Regards!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop through xml hacking_mike Classic ASP XML 12 February 8th, 2010 05:15 PM
Loop through XML? Andy-7M XSLT 8 May 5th, 2007 06:03 AM
Producing a loop of XML in CSV niceguycarl XSLT 0 February 6th, 2006 12:22 PM
Writing XML file within Loop (c#) rathbird General .NET 0 December 13th, 2004 05:26 PM
Loop in XML DOM? omallec XML 3 November 27th, 2003 09:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.