by-expession

Expression Web Resources

XML

Latest post 02-25-2007 11:16 AM by cdwise. 8 replies.
  • 02-14-2007 2:45 AM

    XML

    I am going nuts with this thing. I wanted (and still do) to have a phone book of sorts with avatar type pictures to the left of each name, address, phone, and email entry. I can do that in a snap with a table but, hey, I'm using EW and becoming a better web master. Right?

    I said to my self, "Self, you need to use that thingy they are calling xml to display that data on your web page."  Well, I dug right in with blissful abandon. I created a staff.xml page with the correct doctype and all. I won't even talk about the ignominy of attempting to create that in Excel. Nope, won't even go there. Then I created a new page in EW, called it staff.htm believe it or not. Now I remember seeing a video, training what-U-might call it thingy that said drag the .xml file onto the design view of your ,htm file, so I did. Damb! oops Darn! There was my data in a table format on the page. Didn't look good in that table format but it was there.

    No problem I'm thinking, I can format this and make it look just like I want it to look. Well, drag and drop didn't do anything for me so I clicked on the little arrow up at the top right. Wa-la, there are some layouts to pick from. This is getting pretty easy even if I do say so myself. Couldn't get what I wanted that way. Sooooo, I went to code view and found that my data was in and ifram and there was nothing for me to format or play with. I decided I must need more information about the xml stuff so I went to www.w3schools.com and read, read, and re-read the stuff on xml.

    Their stuff didn't look anything like my stuff so I figured, no biggie, I'l just do what they say with the data they are using and figure it out. IT DON'T WORK in my version (registered retail copy) of EW.

    They are using <xml id="staff" src="staff.xml"></xml> and then a table to plug the data into. As soon as I type <xml I get this red line and holding the cursor over the xml I get told "can't do that here."  I was in code view so plowed on and put every thing on the page exactly like it was in the tutorial. I figured maybe EW didn't know what it was talking about. Seems like EW knows but I don't. Looking at my page in the browser shows an empty table but no data. I thought maybe I needed some special doctype for the html page but that wasn't it.

    Now don't get upset at me for asking inane questions but can someone please tell me why the <xml id="staff" src="staff.xml"></xml> won't work?

    Bob Crawford
  • 02-14-2007 2:48 PM In reply to

    • Jiggy
    • Top 75 Contributor
    • Joined on 02-13-2007
    • Posts 2

    Re: XML

    Did you come across the following?

    http://www.w3schools.com/xml/xml_data_island.asp

    It appears that the XML tag is an IE only element and is therefore invalid by default in EW since it isn't CSS2 standards compliant.

     

  • 02-14-2007 10:53 PM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 541

    Re: XML

    I see Jiggy gave you his answer but have you tried using the XML connector in the data source task pane?

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

  • 02-15-2007 4:10 AM In reply to

    Re: XML

    I have to disagree with Jiggy but I am not versed enough to debate the issue with him.

    I have looked at and used the Data Source Details. I can drag see the data and scan through it with no problems. I can drag my staff.xml file to the design view of my page and get all the data displayed in a table. I can click on the arrow at the top right of the table and select canned layouts. I created a style.xsl file and attached it properly but EW creates it's own xsl style sheet and uses that.

    My xml file is valid, my xsl file is valid. I just can't figure out how to to make it look the way I want it to look. I have looked everywhere trying to find the answer but can't find it. Guess I'll keep looking.

     I do have a second questions maybe someone can answer for me. One of the fields I have is <pic></pic> with the intent of adding a picture to display with a corresponding title, name, email address, and phone number. How do I put a link to a gif file in my xml data file? If I drag the picture to the cell in the table, it repeats in all records.
     

     

    Bob Crawford
  • 02-17-2007 4:07 PM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 541

    Re: XML

    Hmm, Wayne shows how to do that in one of the Expresion Webcasts over on MSDN Events but I do not reember which one, sorry.

    XML is on my to-do list.

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

  • 02-23-2007 5:31 AM In reply to

    Re: XML

    Sorry to butt in, because I'm no expert, but if this is a long-term project, maybe you should think about server-side XML translation. Then you'd only have to worry about it once. I've briefly done some XSLT, but after learning some PHP methods, it made it a lot easier to integrate my XML with the rest of the web application I was building.

    Now, of course, you can't use PHP in EW, but I'm sure there's some good XML translation in ASP.NET too. That is, assuming you have some knowledge of that or have time to learn an entirely new language for the scope of this project. <g>
    Jonathon VS Freelance Web Artist www.jonathonvs.com
  • 02-25-2007 3:40 AM In reply to

    Re: XML

    cdwise:

    Hmm, Wayne shows how to do that in one of the Expresion Webcasts over on MSDN Events but I do not reember which one, sorry.

    XML is on my to-do list.

     

    I have not been able to find the web casts you refer to. 

    Bob Crawford
  • 02-25-2007 3:45 AM In reply to

    Re: XML

    Jonathon VS:
    Sorry to butt in, because I'm no expert, but if this is a long-term project, maybe you should think about server-side XML translation. Then you'd only have to worry about it once. I've briefly done some XSLT, but after learning some PHP methods, it made it a lot easier to integrate my XML with the rest of the web application I was building.

    Now, of course, you can't use PHP in EW, but I'm sure there's some good XML translation in ASP.NET too. That is, assuming you have some knowledge of that or have time to learn an entirely new language for the scope of this project. <g>

    Butting in is what a forum is all about. The more people who get involved the better.

    I have discovered while playing around with this little project that I don't know enough  about XML to even ask the right question. I went back to using a table to format the information I was trying to put on my page. I'll be heading to the book store to get a book on XML and do a little more studying. It seems to be very easy to make the XML data page but putting that information on a web page is a whole other story.

    Bob Crawford
  • 02-25-2007 11:16 AM In reply to

    • cdwise
    • Top 10 Contributor
    • Joined on 12-22-2006
    • Houston, TX
    • Posts 541

    Re: XML

    Of course you can use PHP in Expression, you just need to specify a characterset other than UTF-8 and for your php includes either use an extension other than php or put a chanracterset meta inside a php statement so that Expression sees it but does't actually send it out to the browser (solution thanks to Christop Schneegans and Chris on the MS public newsgroup)

    <?php /* ?>
    <meta http-equiv="Content-Type" content="text/html; charset=Iiso-8859-1 />
    <?php */ ?>

    Use the characterset of yoru choice, mine is as above. Of course there is no Intellisense but that shouldn't be a big problem.

    Cheryl D Wise MS MVP Expression Instructor: starttoweb.com

Page 1 of 1 (9 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems Sponsored by: Start to Web
@ 2005-2008 Cheryl D Wise