|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
NEWBIE: Is this a valid XML document?
Is this a valid XML document?
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<template>
<fileName>test2.html</fileName>
</template>
<document>
<field>
<name>TXT_TEXT1</name>
<value>True</value>
</field>
<field>
<name>TXT_TEXT2</name>
<value>False</value>
</field>
</document>
|
|
#2
|
||||
|
||||
|
No. Only 1 top-level element is allowed in an xml file.
Now if you wrapped the <template> and <document> tags in, say <xmldata> tags it would be valid, but wouldn't really do much. XML is usually for data. XSL is used to style/process that data (<xsl:template>). ...just what are you trying to do? Is the html file reference just data, or are you trying to incorporate that file into xml or incorporate the xml into the html file? |
|
#3
|
|||
|
|||
|
Here is what I am trying to do...
I am writing an application where a user has a number of forms that they can choose to fill out. By "forms" I mean, tax forms, loan forms, etc. I want to give them the ability to save the form at any given point. I want to save the info into an XML document that has the name of the form field and it's value. At a later point, I want the user to be able to import his saved form so they can continue editing it. The value stored in the <template> tags is the original document that the user filled out. The "Save" button has a form action that points to a ColdFusion page that creates the XML document. I have tried using XSL to display the imported data, but I'm still having some issues with it. I figured that my next best option would be to have ColdFusion parse the XML document. I realize that using CF to parse doesn't require the XML document to be written properly. At some point I will probably redo this though. Any suggestions are welcome. Thanks! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > NEWBIE: Is this a valid XML document? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|