Read XML Form source

Hello all,
I'm trying to programaticaly read the contents of an XML Form. I get my resource, grab it's content, get an input stream and start reading. The problem is that instead of a simple XML file being read, what comes back is an entire HTML page with all the layout for the list viewer form, not the XML source.
The code that I'm using is below, I know that it's bad but this is just a test program so it doesn't matter.
StringBuffer sb = new StringBuffer();
IResource res = ....;// Here I get my resource
try{
  IContent con = res.getContent();
  try{
    InputStream is = con.getInputStream();
    int c;
    while((c = is.read())!=-1){
      sb.append((char)c);
    scrollingText = addToText(scrollingText, sb.toString()+"<br>");
  }catch(ContentException e){
  }catch(IOException e){
}catch(ResourceException rE){
So is it possible to access the XML source so that I can read values of specific elements? How?
Regards,
Patrick.

Hi Patrick,
Please check out my reply in this thread :
Re: Access XML content of XMLForm input
Basically you need to use getUnfilteredContent() instead of getContent(), so that the XML doesn't get formatted by the resource filter.

Similar Messages

  • Read XML Form Builder Data

      Dear All,
    I want to read all the data from xml form builder file which is located in KM Folder.
    I want to pass all the related data to other third party tool .
    how can I pass that data to other tool from KM folder directly .
    please give me solution for the same.
    Thanks in advance .
    Thanks & Regards,
    Meghal Shah

    Hi Meghal,
    Please have a look at below help link and see if it helps:
    http://help.sap.com/saphelp_nw74/helpdata/en/4c/4e889a7ba25fb6e10000000a15822b/content.htm?frameset=/en/4c/4e889a7ba25fb6e10000000a15822b/frameset.htm&current_toc=/en/b3/72eb4fe26740aeb5d355c6c52e2639/plain.htm&node_id=266&show_children=true#jump266
    Regards,
    Herman
    SAP AGS

  • Help Needed, problem reading a configuration file in XML form

    Hello,
    I am using NetBeans 6.5.1 with Apache Tomcat 6.0.18.
    I am trying to develop a web application and in my source files I have a thread that loops every second and reads the contents of a configuration file which is in XML form using java.util.Properties.
    As soon as I call props.loadFromXML(new FileInputStream(file)); I get several exceptions that I don't know what they mean nor I know how to resolve them.
    I would apreciate any help you guys can provide.
    Here is what I get in NetBeans:_
    Apr 30, 2009 8:56:53 PM com.sun.xml.ws.transport.http.servlet.WSServletDelegate destroy
    INFO: WSSERVLET15: JAX-WS servlet destroyed
    Apr 30, 2009 8:56:53 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
    INFO: WSSERVLET13: JAX-WS context listener destroyed
    Apr 30, 2009 8:56:53 PM org.apache.catalina.loader.WebappClassLoader findResourceInternal
    INFO: Illegal access: this web application instance has been stopped already. Could not load META-INF/services/javax.xml.parsers.DocumentBuilderFactory. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
    Apr 30, 2009 8:56:53 PM org.apache.catalina.loader.WebappClassLoader loadClass
    INFO: Illegal access: this web application instance has been stopped already. Could not load com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
    java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at javax.xml.parsers.FactoryFinder.getProviderClass(FactoryFinder.java:111)
    at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:146)
    at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:233)
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
    at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:75)
    at java.util.XMLUtils.load(XMLUtils.java:57)
    at java.util.Properties.loadFromXML(Properties.java:852)
    And following the above I get:_
    Apr 30, 2009 8:56:53 PM org.apache.catalina.loader.WebappClassLoader loadClass
    INFO: Illegal access: this web application instance has been stopped already. Could not load com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
    java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
    at javax.xml.parsers.FactoryFinder.getProviderClass(FactoryFinder.java:111)
    at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:146)
    at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:233)
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
    at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:75)
    at java.util.XMLUtils.load(XMLUtils.java:57)
    at java.util.Properties.loadFromXML(Properties.java:852)
    Thanks in advanced.

    kimskams wrote:
    Very Sorry Problem Remains... I checked Scanner on a Smaller file (to give u fast feedback) but I think the spaces in Small file were normal.. that is why it worked..
    In fact I can feel some word on the blank line (hidden words).. its cursor who evidence their presence so Its not working..
    Its a big program which is accessing a lexical resource so I think what I copied was Ok..
    If u still have some solutions then please tell me otherwise I have to remove these blank lines manually for the time being but its not solution.
    I m trying alsoI don't think anyone can give you an answer: people here don't know how your file looks like. Obviously those lines (when the Scanner instance stops reading) are not just empty lines.

  • XML FORM  -  How to save read-only controls with a default value

    Hello everybody,
    I have a 3 xml forms, each one to create one type of news. I need to use 3 because each of this forms has their own controls. But the control which indicates the type of news (asociated with a KM Predefined Property) must be common in the 3 forms, in order to use it on searches.
    The question is, how can I include in this forms a control:
      - Visible for the user
      - With a default value defined in the control properties (each form has a different value, corresponding with the type of news)
      - Read-only mode
      - The value showed in the control must be saved in the associated KM Predefined Property when the user clicks the Save button. 
    Anyone knows how to do this?
    What control can I use?
    I was thinking of trying with text boxes, but I don't find the way to make them unwritable (Read only mode).
    It is posible using labels?
    Thanks.
    Kind regards

    Hello Jose,
    I know you responded with a question... I see it in the email, but I don't see it here!  Very odd... but in response:
    The first thing I do when I open the Edit.xsl file is do a 'find' for the name of the text field that I want to be read-only (in my test case, it's 'location').  Repeat the find until you see something like:
    [code]<!--
    field location
    -->[/code]
    Below there is where I put the new code.  Mine looks like this:
    [code]- <xsl:choose>
    - <xsl:when test="location='' and ($editmode='create')">
    - <xsl:choose>
    - <xsl:when test="./xf:ValidationError/@tagname='location'">
    - <input name="location" size="30" type="text" class="urEdfiTxtEnbl" id="field_1157467268006">
    - <xsl:attribute name="tabindex">
    - <xsl:choose>
      <xsl:when test="$accessibilitymode='true'">21</xsl:when>
      <xsl:otherwise>3792</xsl:otherwise>
      </xsl:choose>
      </xsl:attribute>
    - <xsl:attribute name="value">
      <xsl:value-of select="''" />
      </xsl:attribute>
    - <xsl:attribute name="readonly">true</xsl:attribute>
      </input>
      </xsl:when>
    - <xsl:otherwise>
    - <input name="location" size="30" type="text" tabindex="3792" class="urEdfTxtEnbl" id="field_1157467268006">
    - <xsl:attribute name="value">
      <xsl:value-of select="''" />
      </xsl:attribute>
    - <xsl:attribute name="readonly">true</xsl:attribute>
      </input>
      </xsl:otherwise>
      </xsl:choose>[/code]
    I put the <xsl:attribute name="readonly"> in both places (when test, and when not test).  I'm not entirely sure if that's necessary, but that worked for me.
    Hope this helps,
    Fallon

  • How can I open XML form in the Adobe reader, but not through the browser extention

    I am saving the document as Adobe Dynamic XML Form (useing Adobe LiveCycle Designer), When I open the document I get this error and I do have a Adobe reader installer.
    Please wait...
    If this message is not eventually replaced by the proper contents of the document, your PDF
    viewer may not be able to display this type of document.
    You can upgrade to the latest version of Adobe Reader for Windows®, Mac, or Linux® by
    visiting http://www.adobe.com/go/reader_download.
    For more assistance with Adobe Reader visit http://www.adobe.com/go/acrreader.
    Windows is either a registered trademark or a trademark of Microsoft Corporation in the United States and/or other countries. Mac is a trademark
    of Apple Inc., registered in the United States and other countries. Linux is the registered trademark of Linus Torvalds in the U.S. and other
    countries

    Open the form in Adobe Reader.

  • Reading the form as XML, using WDJ

    Hello.
    I'm using WD for Java and ZCI layout.
    I've seen this thread-
    Re: Data in dynamic table not pass to webdynpro java
    about getting data from tables in the form by reading the form's XML data.
    I tried to search for a method to get the XML in IWDInteractiveForm, and other classes, but I didn't find anything.
    So how can I get the form's XML when the user clicks Submit?
    Best regards,
    Arik.

    Hi Kathy
    After loading a form over XML, we made the experince that in matrices link buttons will not appear everwehere they should. It's a tricky part and we made a work around by changing the columns order and then...the Link Buttons came up ok.
    regards
    Kurt

  • XML form field should be read only.

    Hi All,
    Can we have a field in a XML form which is read only and the number in field should be incremented every time a new form is created.
    Is this possible.If yes can someone please guide me how.
    Thanks,
    Nikhil Pai

    Hi Nikhil,
    Do u want this property to come in the Edit form also, or only on the show form?
    If its only on show form,
    1. Keep a text file in KM with a starting number say 1000.
    2. While creating the XML form, a KM Service listening to resource creation only in the folders,
    will update a property and also edit the text file and replace the number by 1001.
    So in the show form u will have a unique number for each XML form.
    Regards
    BP

  • Read the entire content of XML Form progamatically

    Hi,
    I want to write a program which can read the entire content of XML Form.
    In some of the xml form, some entity like Title etc are coming from Metadata property.
    But i want to read everything through the java code.
    I can read the xml file, but it doesnot give me information on Title,  as its coming from metadata property.
    Any help in this regard will be highly appreciated.
    Thanks and Regards
    Puneet

    Question opened for long, so closing it

  • Does Ipad adobe reader allow to fill a  dynamic xml form created on LiveCycle?

    The form was created using LiveCycle Designer ES3 for the purpose of being filled out on the spot at the client and then submitted as email attachment. However, Adobe reader does not seem to be able to open it giving the following error:
    "Please wait... If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document..."
    The form is dynamic XML, and in the description of the Adobe Reader for the Ipad, it mentions that it is capable of opening forms under the Livecycle rights.
    However, if the Reader can not open dynamic XML's, how can I convert the form into a compatible fillable form for the Ipad?
    Thanks.

    LiveCycle Dynamic XML Forms are not supported in the Mobile versions of Adobe Reader.

  • XML Forms & Read me link

    Can anybody help on this issue i'm having.
    I've created a XML form to display company news.  When the news is created I want the functionality to be able to include attachments, which i have done by including a browser control, type RID, style 'Report Link' on the 'show' form.
    However it could be that the user wants to attach >15 documents.  I tried to do this using the same concept linking to a KM folder opposed to a file, however when trying to display the contents of the KM folder i get the following message:
    <i><b>
    'The folder you are looking for has no displayable content.
    You can try one of the following:
    Access the folder using the Navigation user interface.
    Access the folder as a Web folder. Your operating system and browser dictate whether or not this will work. '</b></i>
    I would appreciate if anyone else has had the similar issues and how it was resolved.
    Thanks
    Mark

    Trevor,
    I've got a text control on the form of name 'RelatedLinks..'  At the bottom of this post is an extract of the 'show form'.  The section in bold is where was previously set to just
    <p>
    <b><xsl:value-of select="RelatedLink"/></b>
    <p>
    and was replaced by
    <p>
    <b><xsl:value-of select="'/irj/go/km/navigation/'"/>
    <xsl:value-of select="RelatedLink"/>
    <xsl:value-of select="'?rndLayoutSet=DisplayAttachments'"/></b>
    <p>
    Hope this makes sense.
    <p>
    Cheers
    Mark
    <p>
    PS.  Please note that if you make any amendments and republish the form you will have to change this form again.
    <p>
    <xsl:if test="RelatedLink!=''">
                      <a tabindex="12406" class="urLnkReport urTxtStd">
                        <xsl:attribute name="title">
                          <xsl:value-of select="$resources/TEXT[@AKEY='tol_LD_1186483059751']"/>
                        </xsl:attribute>
                        <xsl:if test="RelatedLink!=''">
                          <xsl:attribute name="href">
                            <xsl:variable select="translate(substring(RelatedLink,1, 11), $ucletters, $lcletters)" name="lcval"/>
                            <xsl:if test="not(starts-with(normalize-space($lcval), 'javascript:'))">javascript:open_url_customized('<xsl:choose>
                                <xsl:when test="starts-with(RelatedLink, 'imagepath/')">
                                  <xsl:value-of select="$imagepath"/>/<xsl:value-of select="substring-after(RelatedLink, 'imagepath/')"/>
                                </xsl:when>
                                <xsl:when test="starts-with(RelatedLink, '$imagepath/')">
                                  <xsl:value-of select="$imagepath"/>/<xsl:value-of select="substring-after(RelatedLink, '$imagepath/')"/>
                                </xsl:when>
                                <xsl:when test="starts-with(RelatedLink, '%projectroot%/')">
                                  <xsl:choose>
                                    <xsl:when test="$projectroot!=''">
                                      <xsl:value-of select="$projectroot"/>
                                    </xsl:when>
                                    <xsl:otherwise>/arco_content/products</xsl:otherwise>
                                  </xsl:choose>/<xsl:value-of select="substring-after(RelatedLink, '%projectroot%/')"/>
                                </xsl:when>
                                <xsl:when test="starts-with(RelatedLink, '%projectimagepath%/')">
                                  <xsl:choose>
                                    <xsl:when test="$projectroot!=''">
                                      <xsl:value-of select="$projectroot"/>
                                    </xsl:when>
                                    <xsl:otherwise>/arco_content/products</xsl:otherwise>
                                  </xsl:choose>/<xsl:value-of select="substring-after(RelatedLink, '%projectimagepath%/')"/>
                                </xsl:when>
                                <xsl:when test="starts-with(RelatedLink, '%xmlformsroot%/')">
                                  <xsl:value-of select="$imagepath"/>/<xsl:value-of select="substring-after(RelatedLink, '%xmlformsroot%/')"/>
                                </xsl:when>
                                <xsl:when test="starts-with(RelatedLink, '%imagepath%/')">
                                  <xsl:value-of select="$imagepath"/>/<xsl:value-of select="substring-after(RelatedLink, '%imagepath%/')"/>
                                </xsl:when>
                                <xsl:when test="starts-with(RelatedLink, '%contentaccess%/')">
                                  <xsl:value-of select="$contentaccess"/>/<xsl:value-of select="substring-after(RelatedLink, '%contentaccess%/')"/>
                                </xsl:when>
                                <xsl:otherwise>
                                         <b><xsl:value-of select="'/irj/go/km/navigation/'"/>
                                  <xsl:value-of select="RelatedLink"/>
                                  <xsl:value-of select="'?rndLayoutSet=DisplayAttachments'"/></b>                            </xsl:otherwise>
                              </xsl:choose>')</xsl:if>
                          </xsl:attribute>
                          <span style="font-family:Verdana;color:#000000;">
                            <u>
                              <xsl:value-of select="read_link_text"/>
                            </u>
                          </span>
                        </xsl:if>
                      </a>
                    </xsl:if>
                  </p>

  • Importing XML form data, and reading a PDF form in Reader

    The title pretty much says it all. My colleagues have the latest in Adobe Reader (9). They would like to import the form data that they receive in their email as an xml attachment. They would like to read the form as it is filled out in their reader.
    Please tell me how.

    I think they have to have Acrobat to import the data. Reader was not meant to keep data for the user unless Reader Right's are enabled (limited use of form for this typically). The US gov't has done this for years for tax forms at a substantial cost I am sure. The Reader Right's that comes in Acrobat is limited to the number of uses of the form, but the full rights can be negotiated with Adobe for more than 500 uses.
    The answer used to be to buy your colleagues Acrobat, it would be cheaper than paying the additional enabling cost. With the limited use of the rights with the current versions, Adobe has made a compromise on there old policy. You might look at PlanetPDF to see if there are some third party applications that would meet your need.

  • How to reduce a PDF document that contains an Adobe XML form?

    Hi,
    I have created some fillable PDF files using Adobe LiveCycle Designer and used Adobe Acrobat Pro XI to save it as Reader Extended PDF > Enable More Tools (includes form fill-in and save)…
    The form includes image, text field, check box, radio button, table and other controls, as well as java scripts behind. The files are from 1 to 3 MB in size. I tried Reduced Size PDF and Optimized PDF, but I got a message: “This PDF document contains an Adobe XML form. Such files cannot be optimized.”
    My questions are:
    Is there a way I can reduce the file greatly, say about 100 KB?
    And after the size reduced,  does it still keep the original quality in format and function?
    Thanks

    Hi,
    if you only use default fonts like Arial or Myriad don't embed fonts into the form at all.
    If you have to use a specific font because of corporate identity you should check if there are fields in your fom using other fonts like Arial.
    Especially floating fields are a reason for big files as they use Designers default font even if you'll never see it in the PDF.
    When using images, you should not check the "embed" checkbox, as this will save the images a base64-stream into the xml-source.
    If unchecked the images are stored as hex-stream in the PDF-stream which cause a smaller file size.
    Also, don't use high res images, 150dpi are far enough. You also don't need 16Bit depth as Designer only supports 8Bit images with RGB colors.

  • XML Data source in BI 7.1

    Hello all,
    how can I create a XML-Data source in BI 7.1. In former time when we had 3.5 we have created an InfoSource and assign them to a Data Source. in the Data Source underneath "Extras" we could create a Datasource with SOAP connection.
    In the new 7.1 world we do not want use InfoSources anymore, but how we can create a XML Data Source?
    Any ideas would be great.
    Best Regards,
    Stefan from Munich/Germany

    Hi Stefanos,
    Check beow blog for reference...
    /people/community.user/blog/2007/08/13/sap-netweaver-70-bi-how-to-send-xml-data-to-bi--enhancement
    Regards,
    KK.

  • Creating XML Forms

    Hai Experts,
    Can anyone guide me in creating XMLForms

    hi,
    Using XML forms Builder,The form can be EDIT form,Render List item Form or Show form.
    Are you making an EDIT form also?
    Did you map the elements of list form  with the Form schema elements?Do outline the steps you took.
    Looks like the source for the list form is not being found.
    You can read the document <a href="https://media.sdn.sap.com/html/submitted_docs/Best_Practices/EP/documentation/How-to_Guides/KM/How%20to%20create%20XML%20forms.pdf">https://media.sdn.sap.com/html/submitted_docs/Best_Practices/EP/documentation/How-to_Guides/KM/How%20to%20create%20XML%20forms.pdf</a> for detailed explanation on using XML forms.
    Regards,
    Siddhartha
    Message was edited by: Siddhartha Jain

  • XML form Changes

    Hi All,
    We are having few XML forms in landscape.There is a requirement to put some text messages in the existing form.
    For example if i click on submit button , it must throw a message that your form has sent for approval.I have forms builder and opened the existing form.Have created a copy of this by saveas option.i have clicked on submit button in EDIT FORM and the properties of submit are
    class Button
    Caption Submit
    Action Display
    Style Emphasize
    Description
    Alignment
    Vert Alignent
    X
    Y
    I tried to change the action from save to ( Link to source text, display,edit ,create).
    I got struck here .
    Please let me know the procedure to edit this form and put the message when i click on submit button.
    I need this message after validationg the form input fields.
    Thanks in advance..
    Sridar.

    To brief my requirement i have an existing form where i need to put some popup message after clicking submit button.the question here is
    1.Where do i find the source code for this ( navigation steps please)
    2.What are the steps i follow in changing the existing forms.
    3.is it possible to put a popup in xml form
    thanks in advance..

Maybe you are looking for