Create an XML document from a HTML form???

Good morning, is it possible to create an XML document from a HTML form
if yes, can someone tell me how to proceed exactely, I would be very thankful!

Hi,
A very simple intro at this link. Apologies for anything unclear.
http://cswww.essex.ac.uk/TechnicalGroup/TechnicalHelp/xmlCreate.htm
best
kev

Similar Messages

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • How to Create an XML document from XSQL servlet which follows a particular DTD struct

    how to Create an XML document from XSQL servlet which follows a particular DTD structure.Could anyone send me a sample code for this.

    You'll need to associate an XSLT transformation with your XSQL page that transforms the canonical result into your DTD-valid format.
    For example, given an XSQL page like:
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="rss.xsl" ?>
    <xsql:query max-rows="3" connection="demo" xmlns:xsql="urn:oracle-xsql">
    select title,id,description,url,to_char(timestamp,'Mon DD') timestamp
    from site_entry
    order by id desc
    </xsql:query>and an "rss.xsl" stylesheet that looks like this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes" doctype-system="rss-0.91.dtd"/>
    <xsl:template match="/">
    <xsl:for-each select="ROWSET/ROW">
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    <xsl:for-each select="ITEM">
    <item>
    <title><xsl:value-of select="TITLE"/></title>
    <link><xsl:value-of select="URL"/></link>
    <description><xsl:value-of select="DESCRIPTION"/></description>
    </item>
    </xsl:for-each>
    </channel>
    </rss>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>You produce DTD-valid output against the rss-0.91.dtd DTD that looks like:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!DOCTYPE rss SYSTEM "rss-0.91.dtd">
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>
    <rss version="0.91">
    <channel>
    <title>Do You XML?</title>
    <link>http://xml.us.oracle.com</link>
    <description>Oracle XML Website Demo</description>
    <language>en-us</language>
    </channel>
    </rss>

  • Creating an XML document from a DTD in Java

    Hi All,
    I need help on the following requirement very badly. Pls help me.
    I have a requirement to implement with java and XML. I am quit new to XML.Can any of you pls help me.
    I have a DTD file. I need to generate XML document from it using java code. I have to use DTD as a template to generate my XML document.
    After going through WEB sites, I understtod that, we have to user Java API JAXB for my requirement. But I could not find JAXB.jar anywhere.
    I need to know the following inforamtion ....
    1. Is my understanding of using JAXB for my requirement is correct?
    2. Where can I get JAXB.jar?
    3. What are the steps to create XML document from a DTD in Java?
    If can give me a sample code for this would help me a lot.
    Pls pls reply me. Your help is greatly appreciated.
    Thanks in Advance.
    Regards,
    Gayathri.

    hi Gayathri,
    iam currently working in the same field.
    firs download jaxb from this link:
    http://java.sun.com/xml/downloads/jaxb.html
    first u need to marshall it.
    cheers
    shashi

  • How to use java to create an XML document from an SQL database?

    Hi,
    I'm a complete novice at XML and have only recently started programming in Java.
    I'm currently trying to develop a package in Java 1.1.8 which requires a set of very specifically formatted XML documents. These documents would need to be updated regularly by people with no knowledge of Java and I would like to make it as simple as possible.
    Since the data will already be in an SQL database, I thought it might be possible to generate the XML documents from the data using a small Java application, but I'm not too sure how to go about this or if this is even possible! Any help or pointers in the right direction would be very much appreciated.
    Louise

    Do you have the option of upgrading to a newer version of the JDK?
    JAXB does what you are wanting very easily. Also there are tools if you don't want to write your own. JAXB is available as early release on Sun's site as is the newest JDK. Otherwise, you have to design a factory and interface that will do this for you (which is what JAXB basically is in a very simplified view).

  • Create single XML document from multiple queries

    hi all!
    being a new programmer in XML world,my question might sound a bit stupid but your answers would mean a world to me. i have to generate a single XML document from my database by querying more than one table. for example i have 3 tables i.e HR_EMP_NAME, HR_PRODUCTS_DETAIL, HR_PAYROLL_SUMMARY. all three tables have completely different columns except one ID column which is a foreign kay from HR_MASTER_LIST. i want to get any insert operation on these tables as a single document. so far as i have studied, one option is to generate XMLDoc using XSU and then add child nodes using JAXP but i am ot geting the logic right.
    please do reply.
    thanks a lot
    usman

    This is an SQL/XML based answer so how much it helps you is hard to say, but it would be one option. You can have the SQL statement build the XML for you as shown by this simple example.
    SELECT XMLElement("root",
              XMLForest(emp.dummy AS "emp_name",
                        prod.dummy AS "prod_lvl",
                        pay.dummy AS "pay_scale"))
      FROM dual emp,
           dual prod,
           dual pay
    WHERE emp.dummy = prod.dummy
      AND emp.dummy = pay.dummy;which produces (formatted for human readability)
    <root>
      <emp_name>X</emp_name>
      <prod_lvl>X</prod_lvl>
      <pay_scale>X</pay_scale>
    </root>Whether that works with what you are trying to do via Java you will have to decide.

  • Trying to create a XML file from an ASP Form

    I have an ASP form on my website that generates a XML data
    file, but there are a few problems with it. First, when I generate
    the file, it creates a new file every time a user clicks on
    "Submit" and I would like the data to just be appended to a
    particular, existing XML file...how can I append the data to the
    XML file? The code I am currently using is shown below.
    Secondly, I need to nest/repeat certain fields within the XML
    file. Basically, I want the XML file to look like this (I
    simplified the code for ease of writing, so don't bother with the
    syntax):
    <Recipe>
    <RecipeName>
    <SubmittedBy>
    <Ingredients>
    <Amount>
    <Unit>
    <Ingredient>
    <Description>
    <Directions>
    <Recipe>
    <RecipeName>
    etc...
    How would I create a form that would create that type of XML
    file? Think of a MS Access form with linked subforms, but I don't
    want to repeat more data than I have to.
    Any advice or help would be very appreciated!!! Also, if you
    know of a 3-party product that might solve this for me, I am open
    to that also!
    Thanks!!!
    ASP Page Code:

    You may find this article useful
    http://xmlfiles.com/articles/michael/appendxml/default.asp
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "kbeveridge6778" <[email protected]> wrote
    in message
    news:[email protected]...
    >I have an ASP form on my website that generates a XML
    data file, but there
    >are
    > a few problems with it. First, when I generate the file,
    it creates a new
    > file
    > every time a user clicks on "Submit" and I would like
    the data to just be
    > appended to a particular, existing XML file...how can I
    append the data to
    > the
    > XML file? The code I am currently using is shown below.
    >
    > Secondly, I need to nest/repeat certain fields within
    the XML file.
    > Basically, I want the XML file to look like this (I
    simplified the code
    > for
    > ease of writing, so don't bother with the syntax):
    > <Recipe>
    > <RecipeName>
    > <SubmittedBy>
    > <Ingredients>
    > <Amount>
    > <Unit>
    > <Ingredient>
    > <Description>
    > <Directions>
    > <Recipe>
    > <RecipeName>
    > etc...
    > How would I create a form that would create that type of
    XML file? Think
    > of a
    > MS Access form with linked subforms, but I don't want to
    repeat more data
    > than
    > I have to.
    >
    > Any advice or help would be very appreciated!!! Also, if
    you know of a
    > 3-party product that might solve this for me, I am open
    to that also!
    >
    > Thanks!!!
    >
    > ASP Page Code:
    >
    > Function saveXMLData(strPath, strFileName)
    >
    > 'Declare local variables.
    > Dim aXMLDoca
    > Dim aRootNode
    > Dim aFormVar
    > Dim aPI
    > Dim Item
    >
    > 'Create an XMLDOM Object
    > Set aXMLDoca = server.CreateObject("Microsoft.XMLDOM")
    > aXMLDoca.preserveWhiteSpace = True
    >
    >
    > 'Create the root node for the document
    > Set aRootNode = aXMLDoca.createElement("function")
    > aXMLDoca.appendChild aRootNode
    >
    >
    > 'Iterate the Request Object for all form data
    > For Each item in Request.Form
    >
    > 'Do not include the variable if it contains btn
    > If instr(1,item,"btn") = 0 Then
    > Set aFormVar =aXMLDoca.createElement(item)
    > aFormVar.Text = Request.Form(item)
    > aRootNode.appendChild aFormVar
    > End If
    >
    > Next
    >
    >
    > 'Append the processing instruction
    >
    > Set aPI =
    aXMLDoca.createProcessingInstruction("xml","version='1.0'")
    > aXMLDoca.insertBefore aPI, aXMLDoca.childNodes(0)
    >
    >
    > 'Save the XML document.
    > aXMLDoca.save strPath & "\" & strFileName
    >
    >
    > 'Release all references.
    > Set aXMLDoca = Nothing
    > Set aRootNode = Nothing
    > Set aFormVar= Nothing
    > Set item = Nothing
    > Set aPI = Nothing
    > End Function
    >
    > dim strFullFile
    >
    > Function DoesFileExist(ByVal strFullFile)
    > Dim objFSO
    >
    > 'If InStr(strFullFile, ":") = 0 Then
    > 'strFileNam = Server.MapPath(strFullFile)
    > 'End If
    >
    > Set objFSO =
    Server.CreateObject("Scripting.FileSystemObject")
    > DoesFileExist = objFSO.FileExists(strFullFile)
    > Set objFSO = Nothing
    > End Function
    >
    >
    > Const cont_Num=10000
    > Randomize
    > Dim intNumber
    > dim strFile
    > Dim blnYes
    >
    > blnYes=False
    >
    > Do Until blnYes=True
    >
    > intNumber=Int((Cont_Num * Rnd)+1)
    >
    > 'Create a random file name so you don't write over the
    same file
    > strFile="Recipe"& intNumber &".xml"
    >
    > strFullFile="c:\inetpub\wwwroot\xmltest\" & strFile
    >
    > if DoesFileExist(strFullFile)=False then
    > blnYes=True
    > End If
    > Loop
    >
    > ' The page starts here
    > On Error Resume Next
    >
    > ' Save the XML Data
    > SaveXMLData "c:\inetpub\wwwroot\xmltest",strFile
    >

  • Creating an xml document from filenames of selected files

    Hey guys, I am totally new to automator and applescript so please be kind!
    I have an xml/flash image portfolio website which has image galleries. Each gallery has an xml document which specifies a thumbnail and full size photo to be displayed in the gallery. If I want to make a new gallery I have to make a new xml document and enter all the filenames of the images I want to display in the gallery. ( I guess you can see where this is going).
    This is fine if I have 10 images in the gallery but if I want to make a gallery with 350 images in then it could get pretty tedious.
    What I would love to be able to do is select a group of images and then have a script or automator action that can copy the files names and create a new gallery xml document containing the relevant code with all the files names. Ideally then saving the gallery with a sequential filename.
    Tying this into the new contextual services menu in snow leopard would really make the task incredibly easy.
    Is this possible? I'm not scared of learning how to do this therefore some pointers in the right direction would be great.
    Thanks,
    Chris

    Thanks Camalot,
    I was just thinking of selecting images from the finder but if this could be integrated into Aperture's export dialog that would be even better.
    this is the xml:
    <?xml version="1.0" encoding="utf-8"?>
    <gallery thumbwidth="220" thumbheight="138" columns="3" gap="4">
    <item>
    <ID>1</ID>
    <title><![CDATA[Title 1]]></title>
    <desc><![CDATA[This is description 1. <font color="#0099CC">This is a colourful text. </font> This is a <a href="http://www.flashden.net/user/iceonflames">link</a>. <i>This is italic text.</i> <b>This is bold text.</b> <b><i>This is bold italic text.</i></b> This text is styled by a CSS document.<br/><br/>]]></desc>
    <thumb>images/thumbs/7.jpg</thumb>
    <image>images/big/7.jpg</image>
    </item>
    <item>
    <ID>2</ID>
    <thumb>images/thumbs/8.jpg</thumb>
    <image>images/big/8.jpg</image>
    </item>
    <item>
    <ID>3</ID>
    <title><![CDATA[Title 3]]></title>
    <desc><![CDATA[This is description 3. <font color="#0099CC">This is a colourful text. </font> This is a <a href="http://www.flashden.net/user/iceonflames">link</a>. <i>This is italic text.</i> <b>This is bold text.</b> <b><i>This is bold italic text.</i></b> This text is styled by a CSS document.<br/><br/>]]></desc>
    <thumb>images/thumbs/9.jpg</thumb>
    <image>images/big/9.jpg</image>
    </item>
    </gallery>

  • How can I create a XML document from a DOM?

    Hello,
    I'm using the parser for C, version 2 in the DOM modus. How can I dump the object model to a (XML) string after changing some field?
    Do I need to create my own function or is there a function in the DOM interface??

    You need to create your own function. The Java XML parser has such a function
    and we'll probably add one in a future release as well.
    Oracle XML Team

  • Heap space error while creating XML document from Resultset

    I am getting Heap space error while creating XML document from Resultset.
    It was working fine from small result set object but when the size of resultset was more than 25,000, heap space error
    I am already using -Xms32m -Xmx1024m
    Is there a way to directly write to xml file from resultset instead of creating the whole document first and then writing it to file? Code examples please?
    here is my code:
    stmt = conn.prepareStatement(sql);
    result = stmt.executeQuery();
    result.setFetchSize(999);
    Document doc = JDBCUtil.toDocument(result, Application.BANK_ID, interfaceType, Application.VERSION);
    JDBCUtil.write(doc, fileName);
    public static Document toDocument(ResultSet rs, String bankId, String interfaceFileType, String version)
        throws ParserConfigurationException, SQLException {
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            Document doc = builder.newDocument();
            Element results = doc.createElement("sims");
            results.setAttribute("bank", bankId);
            results.setAttribute("record_type", "HEADER");
            results.setAttribute("file_type", interfaceFileType);
            results.setAttribute("version", version);
            doc.appendChild(results);
            ResultSetMetaData rsmd = rs.getMetaData();
            int colCount = rsmd.getColumnCount();
            String columnName="";
            Object value;
            while (rs.next()) {
                Element row = doc.createElement("rec");
                results.appendChild(row);
                for (int i = 1; i <= colCount; i++) {
                    columnName = rsmd.getColumnLabel(i);
                    value = rs.getObject(i);
                    Element node = doc.createElement(columnName);
                    if(value != null)
                        node.appendChild(doc.createTextNode(value.toString()));
                    else
                        node.appendChild(doc.createTextNode(""));
                    row.appendChild(node);
            return doc;
    public static void write(Document document, String filename) {
            //long start = System.currentTimeMillis();
            // lets write to a file
            OutputFormat format = new OutputFormat(document); // Serialize DOM
            format.setIndent(2);
            format.setLineSeparator(System.getProperty("line.separator"));
            format.setLineWidth(80);
            try {
                FileWriter writer = new FileWriter(filename);
                BufferedWriter buf = new BufferedWriter(writer);
                XMLSerializer FileSerial = new XMLSerializer(writer, format);
                FileSerial.asDOMSerializer(); // As a DOM Serializer
                FileSerial.serialize(document);
                writer.close();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            //long end = System.currentTimeMillis();
            //System.err.println("W3C File write time :" + (end - start) + "  " + filename);
        }

    you can increase your heap size..... try setting this as your environment variable.....
    variable: JAVA_OPTS
    value: -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m

  • Create an XML Document with HTML Entities?

    I'm writing a program that uses SAX to parse an XML document and generate XHTML from it, but I would like the XML document to allow HTML entities, of course, in the XML markup.
    Each time my parser gets to any entity at all it dies reporting an undefined entity.
    Is there any way I can refer to the HTML entity DTD or perhaps, in my own DTD, copy and paste the HTML entities? How would I make a reference like this in my XML document?
    Thanks

    Seems to me you would just put something like<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">before your root element. Or whichever DTD you actually want. I found out about them here:
    http://www.utoronto.ca/webdocs/HTMLdocs/HTML_Spec/html.html

  • Creating new analysis gives "Error loading XML Document from ..."

    Trying to create analysis and getting "Error loading XML Document from saw.dll/answers/answersproperties.xml?fmapId=S1clug.
    The response given was:" after choosing subject area. Analysis editor is opened but Subject Areas is empty and can't do anything.
    The problem is on Mozilla 12 (16.0.2, 17.0.1) and IE 8. Chrome works fine.
    My system is Win 7, BI 11.1.1.6.0 is on Oracle Linux (and by the way Mozilla from Linux system works fine)
    What could be the reason of this?
    Edited by: 898973 on 4/12/2012 15:11

    Reinstalling Mozilla with "Remove personal data" option checked resolved the problem.

  • XML-Document from Internet via HTML-Control?

    Hi everybody,
    I would like to access an XML-document from the internet via a HTML-Control and save it in an ABAP XSTRING-Type so i can use the "call Transformation" in order to save it in an ABAP-Table. Is that possible?? or I have to use XI to access such XML-documents.
    Thanks
    Ihssan

    Hello Mr Raja,
    your answer was helpful. There is no problem by accessing XML data from 'http://'-address. But if i try to access the xml data from 'https://'-address it doesn't work. Of course i used a https sheme type.
    Is there problems by getting data from https??
    thanks in advance
    Ihssan
    p.s.: sap_basis release 6.20

  • Create Form Beans from JSP/HTML forms

    In the Builder certification objectives, there is one called "Create Form Beans from JSP/HTML forms". How can I do that? How can I create a form beam starting from the JSP form or HTML form?

    Guys, no one from forum can answer this question?

  • Create an XML file from XSD file in JDeveloper

    Hi,
    I am working on XML DTD and XSD to validate xml file using JDeveloper.
    1. How we can create xml file from XSD in JDeveloper.
    2. How to design content model very easily..
    3. where can I learn XSD easily.. any URL
    can anyone help out..
    with regards
    Abu Sufian

    The XML node in the new gallery has an option to create XML document from schema
    See this demo:
    http://www.oracle.com/technology/products/jdev/viewlets/1013/xml_viewlet_swf.html
    There are several places on the Web that teaches XSD
    for example: http://www.w3schools.com/schema/

Maybe you are looking for

  • Newbie with fill-able form distribution questions

    Please can someone help me understand a few things about creating electronic forms in LiveCyle Designer ES so our HR department can: Make the blank forms available on our Intranet Make the forms fill-able by our own employees with Intranet access and

  • Lrcat files much smaller in LR6???

    Should I be worried? My LR preview files are substantially smaller after the LR update/conversion. Just flipping through them, I can't find any problem but is this size reduction "normal" and are you all seeing it? Just fyi, I have about 160k files a

  • Using j_security_check container authentication with JSF

    Hi All, After quite a bit of looking around, we resorted to using a plain login JSP page with a ServletFilter on j_security_check to have container managed authentication in our JSF based web-site using IBM Websphere 5.1 So, basically every other pag

  • "iTunes cannot run because it...

    When I try to open iTunes, I receive the error message: "iTunes cannot run because it detects a problem with QuickTime/ For repair instructions, click Help." The help supplied suggests an uninstall/reinstall of Quicktime. I tried this, but it didn't

  • Modification of S_ALR_87012103

    Hi, Is it possible to modify "List of vendor line items" program(tcode S_ALR_87012103)? if it is,how to? maggy