Cascading list problem - InfoPath Dev
in

InfoPath Dev

Cascading list problem

Last post 10-29-2008 03:06 AM by Anonymous. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 10-28-2008 06:20 AM

    Cascading list problem

    Hello, I'm working with a new form that will need to utilise a cascading list.  In order to get my head around this, I've been trying to use the "How To" guide on creating a cascading list from a flat data source but I'm encountering problems just going through the guide.  I've copied the code and pasted into a word doc which I've then saved as a .xml file and then added the file as a data connection onto my new blank form.  The problem is occurring when it comes to populating the DDL with the data connection.  When I come to step 4 (Click the Select XPath button to the right of the Entries text box, select Vehicles/Vehicle/year, and then click OK twice to close the open dialog boxes.), I don't get the options of Vehicles/Vehicle/Year but rather get a load of data from the word document -  it still looks like a data source but follows the below layout:

    -WordDocument

       -macrosPresent

       -embededObjPresent

       -ocxPresent

    etc..

    Any ideas as to what I'm doing wrong?  The DDL is not repeating and is really quite a basic cascade as there are only 2 levels but I can't seem to figure this out.

    http://www.infopathdev.com/blogs/greg/archive/2005/07/06/Create-a-Cascading-List-from-a-Flat-Data-Source.aspx

  • 10-28-2008 07:29 AM In reply to

    Hi there -- try pasting the xml into a simple text editor, like notepad, and saving it with a .xml extension. In fact, I'll attach a copy to this post for you, so you can just right click the link and select 'Save As' to get a copy.

    Hope that helps....

    Hilary Stoupa

  • 10-28-2008 07:45 AM In reply to

    Yay, it works!  Thanks so much Hilary - I knew it would be something simple and had tried pasting in notepad but not saved it with the .xml extension :)

  • 10-28-2008 11:12 AM In reply to

    Hoping you can help me out a little bit more - I've used the example file and altered it as necessary to utilise in my form.  It's all been done in notepad and the formatting is identical to the example you sent me but when I'm trying to add the .xml file as a data source I keep getting the below error message :( 

    The form contains XML that cannot be parsed:
    A name contained an invalid character.

    Line 3, Position 12
       <Funding="No" Cheque Value="Under 500" AuthBy="Adrian Grant"/>

    It seems to think the = sign is an invalid character but I can't see how as it's used in the example code.  I thought it may be something to do with formatting or font but I've tried copying the = sign directly from the example code you gave me and still get the error.  I've attached a copy of the ,xml file, if you wouldn't mind looking over it to see if you can figure out what I'm doing wrong it would be hugely appreciated!

  • 10-28-2008 11:38 AM In reply to

    Well, actually, there is a pretty big difference between yours and the sample. In yours, you have an element called Funding. If you want the element of funding to have the value of 'No', it would look like this:

    <Funding ChequeValue="Under 500" AuthBy="Adrian Grant">No</Funding>

    Notice that there is no longer any space between the words 'Cheque' and 'Value' -- we don't put spaces in attribute or element names. ChequeValue and AuthBy are now attributes of the Funding element. If we look at the Vehicles sample:

    <Vehicle year="1963" make="Chevrolet" model="Corvette"/>

    Here we see that there are 3 attributes to the Vehicle, year, make and model. There is no value set in the Vehicle element itself. To do the same with your example, perhaps we'd add an attribute of 'Approved' (since that is my best guess of the 'No' value for funding... ) like so:

    <Funding Approved="No" ChequeValue="Under 500" AuthBy="Alison Milner"/>

    Hilary Stoupa

  • 10-29-2008 03:06 AM In reply to

    Ahh, it's all so clear now - think my head must have been clouded from staring at notepad too long!

    When I looked at both again I realised that in my code I had failed to refer to the actual "Authorised" group, I was able to solve the problem by simply changing it to:

    <Authorisation Funding="No" ChequeValue="Under 500" AuthBy="Adrian Grant"/>

    Thanks again for all your help Hilary - definitely the quickest (and most useable) advice I've had from this site :) 

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.