SAx Output non XML Compliant (Part 2)

This is the question I asked before:
http://forum.java.sun.com/thread.jsp?forum=34&thread=471553&tstart=0&trange=15
my doubt is: what happens when the & character appears in the input data? I.e. not written by me in the XSLT styleSheet.
Is there anything I can put in the stylesheet so the special characters appear escaped?
And if not, is there any class that will escape all the special characters so I can use it in the Contenthandler?
I know I could write one such class, but it seems such a common problem that I'm sure there must be a standard one out there.
Cheers!

I am using a Transformer and getting the output with a Contenthandler. But the output I get hasn't got the special characters converted. I don't know if it is meant to be this way or it is because I'm using a SAXResult or what.
I find it very strange because if I tell my Transformer that the output is XML one would think that it would leave the special characters escaped.

Similar Messages

  • SAX Ouptut non XML Compliant

    I am doing a very simple XSLT transformation, here is the reduced version of the styleshet:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:template match="/csvFile">
              <Companies>
                   <xsl:apply-templates select="line"/>
              </Companies>
         </xsl:template>
         <xsl:template match="line">
              <Company>
                   <Asset>
                        <AssetData>Data for the Assets & amp; modify later</AssetData>
                   </Asset>
              </Company>
         </xsl:template>
    </xsl:stylesheet>and using a ContentHanlder to read the result of my transformation. My problem is that the & amp; symbol is converted to & at the output, hence my XML output is badly formed, is there any way to change this behaviour and tell it to keep the XML character scaping?
    Cheers!

    But what happens if instead of me writing it, the & character appears in the input Data for the transformation?

  • Convert non XML compliant characters to XML compliant ones

    I receive text from a third party program.
    I can expect to receive & ���� < caracters
    How can I surely convert them all to a compliant UTF-8 xml ?

    The solution is to enclose such text with CDATA blocks

  • Anyone know how to output an XML file from ABAP to a non sapgui location?

    I have a program that creates XML and then outputs a file via CALL METHOD cl_gui_frontend_services=>gui_download. But now I want to execute the program in background mode and therefore I need to be able to output that XML to a NON sapgui file location. Current code creates the XML to an internal table which is binary then the gui_download method converts that to output XML. .  Does anyone know how I can change the code to either a) output the XML to an internal table which can be output via, say, a TRANSFER command..or, b) output the created binary table of XML to a NON sapgui file location?
    Excerpts from current code are as follows:
    first the XML is created (to the binary file)
          Creating a ixml factory
      l_ixml = cl_ixml=>create( ).
          Creating the dom object model
      l_document = l_ixml->create_document( ).
          Fill root node with value XML
      l_element_xml  = l_document->create_simple_element(
                  name = 'XML'
                  parent = l_document ).
          Create tag 'HEADER' as child of 'XML'
      l_element_header  = l_document->create_simple_element(
                  name = 'HEADER'
                  parent = l_element_xml  ).
    header information about the file and general data about the fleet follows
      l_value = c_fleet_import.
      l_element_dummy  = l_document->create_simple_element(
                name = 'TYPE'
                value = l_value
                parent = l_element_header ).
    etc.......
    then the xml is connected to the stream factory and rendered
      Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
      Connect internal XML table to stream factory
      l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
      Rendering the document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                            document = l_document ).
      l_rc = l_renderer->render( ).
      Saving the XML document
      l_xml_size = l_ostream->get_num_written_raw( ).
    and then output to the file
      IF sy-subrc = 0.
        CALL METHOD cl_gui_frontend_services=>gui_download
           EXPORTING
             bin_filesize = l_xml_size
            filename     = 'g:\sapdms\BSCC-DEV\EFPAC XML Files\ALL.xml'
           filename     = '/TRICK/727/OUT/ZEFP/EFPAC.XML' "doesnt work with sap gui
             filetype     = 'BIN'
           CHANGING
             data_tab     = l_xml_table
           EXCEPTIONS
             OTHERS       = 24.
    as implied by the comments the method above will successfully output the XML file to the g:drive but will not output to /TRICK/ location, which is where I need it to go in a background mode run.
    This is a problem which has defeated all our local expertise and I would appreciate any help given... Barry Jones

    Try this code below:
    data  l_xml_table2  type table of xml_line with header line.
    W_filename - This is a Path.
      if w_filename(02) = '
        open dataset w_filename for output in binary mode.
        if sy-subrc = 0.
          l_xml_table2[] = l_xml_table[].
          loop at l_xml_table2.
            transfer l_xml_table2 to w_filename.
          endloop.
        endif.
        close dataset w_filename.
      else.
        call method cl_gui_frontend_services=>gui_download
          exporting
            bin_filesize = l_xml_size
            filename     = w_filename
            filetype     = 'BIN'
          changing
            data_tab     = l_xml_table
          exceptions
            others       = 24.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.

  • How to generate PDF from XML output without XML publisher

    Hi,
    I am facing a problem while splitting the rdf generated XML output.
    Problem Description:
    I have a oracle invoice report which runs once every day (scheduled program). This report fetches me the invoices generated on that day and needs to be Mailed / Faxed to the customers.
    So i developed the report in such a way that it generates the output order by customers...since the output generated will be as one .out file in APPLCSF/out directory...the .out file needs to be splitted by customers, for which i have written a cursor which takes the data of the main query and submits that many requests as many as customers are there.....There is a possibility of having 1000 customers per day also. If that is the case then my main program will fire that many requests.
    Is there a different approach......any inputs are highly appreciated.
    Also, i am generating the output in XML format. Is there a way from which i can directly generate a PDF from that XML output rather using any other tool.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

    Hi,
    with Reports Bursting and the defined "distributions" it's possible to have one report splittet to several parts with different receipients. Have a look at http://download-uk.oracle.com/docs/cd/B14504_01/dl/bi/B13673_01/pbr_dist.htm.
    With xsl-fo it's possible to create pdf out of xml ... that's what xml publisher is doing.
    Regards
    Rainer

  • RDF output to XML Publisher

    Hello All,
    Has anyone out there taken output from an RDF and presented it in XML Publisher from concurrent manager 11.5.10.2 ?
    It seems like it might be possible. Maybe:
    -set the RDF output to XML
    -produce an RTF template in Word for the RDF
    -Associate the report with the new template in XML Publisher responsibility
    Sounds like it might work.
    Any help is appreciated,
    Bradley

    I am not sure about the Concurrent Manager part. But with the latest release of BI Publisher standalone, one can convert RDF's directly to BI Publisher Templates. Quite a handy utility. I have blogged about it here http://oraclebizint.wordpress.com/2007/08/22/oracle-reports-to-bi-publisher-conversion-utility/. I am not sure whether this can be used to convert some complex RDF's (which would be the case in ebusiness suite) but this can serve as a good starter.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • Can I route non-XML files with NW PI 7.0?

    Hello,
    I have NW 7.0 PI installed. I need to implement very simple scenario:
    1. There are two folders Source and Target
    2. Any file (non-XML, binary for example) comes to the Source folder
    3. File needs to be picked up and routed without any modifications to the Target folder
    Questions:
    1. Can I implement that with NW? I guess I can
    2. How do I do that? Is there any example or some description of implementing such a simple scenario (I have a few samples on how to implement complex scenarios that work with XML files, but I don't need that complexity)
    Thanks in advance.

    Hi,
    Check out the Sravya's blogs for starters, It has lot of links which will help you to learn various pieces of XI.
    Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part I
    Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part II
    Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part III
    Thanks,
    Pooja

  • Report output in XML format

    Is it possible to save (or export) report output in XML format, it is ok with either WebI or DeskI report, here we are concerned about output format not what type of report we can use to produce the output in XML format.
    Thank you,
    Srini

    Hi Srinivas,
    Only options available in WEBI or DESKI is to save documents in Excel or PDF format.
    As a workaround you can use Excel as an intermediate between your WEBI or DESKI document to XML format.
    When you try to save WEBI document in XML Data format you may get following Error because the Excel sheet does not contain any XML format that requires.
    u201CCan Not save XML data because the workbook does not contain any XML mappingsu201D
    Solution:
    1. Excel cannot save all or part of your workbook as XML Data if you have not created one or more mapped ranges.
    2. If you haven't added an XML map to your workbook, or your data is not contained within an XML list, then you can save your workbook in the XML Spreadsheet file format.
    If you have added an XML map to your workbook, follow these steps to map XML elements to your worksheet:
    1. On the Data menu, point to XML, and then click XML Source to open the XML Source task pane.
    2. To map one or more elements to your worksheet, select the elements in the XML Source task pane. To select nonadjacent elements, click one element, and then hold down CTRL and click each element.
    3. Drag the selected elements to the worksheet location where you want them to appear.
    I Hope this helps to find  the path of solution with Ease.
    Thanks...
    Pratik

  • Product-sku-output-config.xml - Is there a schema definition (XSD or DTD)?

    For the product-sku-output-config.xml file (used to define the set of product and sku attributes that are sent to Endeca from ATG as part of the Baseline Index process, as defined in chapter 4 of the ATGEndecaIntegrationGuide.pdf, 10.1.2 version), is there a schema definition (XSD or DTD) available?
    The format used by product-sku-output-config.xml seems similar to, but not the same as, the format described by http://www.atg.com/dtds/search/indexing-dependency-schema.dtd. For example, p35 of the ATGEndecaIntegrationGuide.pdf gives an example of a product-sku-output-config.xml with a "properties" child element of the top-level "item" element; per that indexing-dependency-schema.dtd, that isn't allowed. (Per that DTD, it should be either "meta-properties" or "text-properties", not "properties".)
    More generally, I'm wondering if there's place that fully defines what can go into the product-sku-output-config.xml file.
    I'm also interested this same question for the category-dim-output-config.xml file.
    Thanks,
    -Jon

    For the product-sku-output-config.xml file (used to define the set of product and sku attributes that are sent to Endeca from ATG as part of the Baseline Index process, as defined in chapter 4 of the ATGEndecaIntegrationGuide.pdf, 10.1.2 version), is there a schema definition (XSD or DTD) available?
    The format used by product-sku-output-config.xml seems similar to, but not the same as, the format described by http://www.atg.com/dtds/search/indexing-dependency-schema.dtd. For example, p35 of the ATGEndecaIntegrationGuide.pdf gives an example of a product-sku-output-config.xml with a "properties" child element of the top-level "item" element; per that indexing-dependency-schema.dtd, that isn't allowed. (Per that DTD, it should be either "meta-properties" or "text-properties", not "properties".)
    More generally, I'm wondering if there's place that fully defines what can go into the product-sku-output-config.xml file.
    I'm also interested this same question for the category-dim-output-config.xml file.
    Thanks,
    -Jon

  • Can a Java Mapping be used on non-xml data

    I would like to use a java mapping to transform non-xml formatted data to an IDOC or XML format.
    1) Does the input or output of a Java Map have to be XML.
    2) If possible can the test feature be used to load and test a non-xml data file.
    3) Any comments or lessons learned in this area.

    Hi Johan,
    below are some suggestions for your scenario:
    <i>
    1) Structured flat picked up using J2EE FTP adapter.</i>
    Indeed; you can use the file adapter to receive/retrieve this file from "any" third party system.
    <i>2) Structured flat converted to XML (Using JAVA mapping?)</i>
    When you send any message to XI, it's the adapter's task to convert this message into a XI understandable format i.e. SOAP. So the flat file to XML conversion is not your concern.
    However, if you need to perform any data transformation (input file to IDOC) then you can opt for XSLT (XML stylesheets),  Java mappings or the XI mapping tool within the repository. Based on my own experience with IDOC mapping, I can tell you that XSLT and/or Java mapping is the best way to achieve this kind of mapping.
    <i>3) XML mapped to SAP IDoc using graphical editor.</i>
    See comments point 2)
    Cheers,
    Rob.
    Message was edited by: Rob Viana

  • My display is non hdcp compliant after Yosemite install

    My display is non hdcp compliant after Yosemite install, fix this?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • [svn:bz-trunk] 20753: * Fixed non UTF8 compliant char in EndpointPushNotifier.java

    Revision: 20753
    Revision: 20753
    Author:   [email protected]
    Date:     2011-03-10 02:40:52 -0800 (Thu, 10 Mar 2011)
    Log Message:
    Fixed non UTF8 compliant char in EndpointPushNotifier.java
    Added tomcat7 support to the maven build of blazeds opt (to support security/Tomcat7Valve.java)
    tested the build with maven3
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/client/EndpointPushNotifier.java
        blazeds/trunk/modules/opt/pom.xml
        blazeds/trunk/modules/opt/poms/tomcat4/pom.xml
        blazeds/trunk/modules/opt/poms/tomcat6/pom.xml
        blazeds/trunk/modules/pom.xml
    Added Paths:
        blazeds/trunk/modules/opt/poms/tomcat7/
        blazeds/trunk/modules/opt/poms/tomcat7/pom.xml
    Property Changed:
        blazeds/trunk/modules/
        blazeds/trunk/modules/common/src/
        blazeds/trunk/modules/core/src/
        blazeds/trunk/modules/remoting/src/

  • "Failed to use non CLS compliant type" when iterating SPLimitedWebPartManager.WebParts

    Hi,
    I having trouble updating a property of a custom web part with PowerShell, that is installed on a client's environment. The custom web part has a property called RowLimit for which I need to set an integer value. 
    Basically what my script does is, it gets the page with the web part (SPFile), then I get all the web parts on the page using the SPWeb.GetLimitedWebPartsManager function. Then I iterate all web parts in the manager using a 'foreach' like below:
    $webpartmanager = $web.GetLimitedWebPartManager($page.Url, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
    $webParts = $webpartmanager.WebParts
    foreach($webPart in $webParts) {
    UpdateWebPart $webPart $webPartType $webPartTitle $xmlReader
    Now, the first few iterations works fine, I get the OOTB web parts and their properties, but as soon as I hit the custom web part I get this error:
    The field/property: "RowLimit" for type: "OurWebPart.WebPart" differs only in case from the field/property: "rowLimit". Failed
    to use non CLS compliant type.
    So from what I've found online is that the web part possibly has two properties, a 'rowLimit' and a 'RowLimit' (which is legal in C#). And I've thought of ways to get around this when trying to update the property, but I'm not even getting to the point of
    making the update.
    Unfortunately I don't have access to the source code for the web part, and even if I did we don't have the option of making it CLS compliant and redeploying - we need to work with what is there.
    Can anyone please shed some light as how to get around this problem? 
    Thanks!

    Hi,
    Thanks for your sharing.
    What’s more, per my knowledge, the RowLimit property is the view pagination size for the web part.
    There is an article about changing the property, you can refer to it.
    http://sharepointblogbyshri.blogspot.com/2013/10/sharepoint-2010-edit-pagination-size.html
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Non XML attachment to XML in sender mail adapter

    Hi,
    I am working with sender mail adapter and usng payloadswapbean. My attachment is non XML and I need to convert it in to XML in order to mapping. How can I do that? Can someone explain if can I use MessageTransformBean for this purpose and if so, how?
    Or any other method for doing this?
    Thanks,
    Rakesh

    Is the attachment in text format? If yes, then after the usage of PayloadSwapBean, you may try using MessageTransformBean in the same module chain. And you will be able to convert it into xml format.
    Regards,
    Prateek

  • Need help to get output in XML

    Hi all
    I am a PL/SQL programmer and have no idea about XML :-(
    I am using ORACLE 10g and my application generates atleast 100 text files a day for customers. These files are manipulated using Utl_File package and gets data from the DB.These files are tab or comma delimeted. Now company wants to give an option to customers to get the same output in XML format. My understanding is that I need to get information from customers first to make the report template for them and then use some XML parser to get data from DB and give an output using that customer's specific template.
    I wanna know, if there is any whitepaper or manual that can guide me step by step. I just need to make an idea how the things can go togather and the sequence of operation.
    Rashid

    Hi all
    I am a PL/SQL programmer and have no idea about XML :-(
    I am using ORACLE 10g and my application generates atleast 100 text files a day for customers. These files are manipulated using Utl_File package and gets data from the DB.These files are tab or comma delimeted. Now company wants to give an option to customers to get the same output in XML format. My understanding is that I need to get information from customers first to make the report template for them and then use some XML parser to get data from DB and give an output using that customer's specific template.
    I wanna know, if there is any whitepaper or manual that can guide me step by step. I just need to make an idea how the things can go togather and the sequence of operation.
    Rashid

Maybe you are looking for

  • Use IMP to only import certain objects?

    Is it possible to use IMP to only import tables, table data, indexes and sequences, or everything except packages?

  • After successful download, Serial number is valid, but qualifying product could not be found on computer

    Successful download of 2nd copy of Acrobat XI Pro to use on Surface Pro. After download error message - Serial Number you provided is valid, but a qualifying product could not be found on this computer. Wants me to select product and enter serial num

  • Standby issue during movies

    Mabook air 2013 , when i watch a movie on itunes or VLC and i move my macbook vertical/ horizontal it will be going to stand by mode..

  • Yosemite mail.app hang

    I just upgraded to Yosemite and have found that Mail.app hangs. I would open it and 10 or 15 seconds later it would hang. I would get a spinning beach ball and Mail was listed as not responding in Activity Monitor. I was able to narrow down the probl

  • Anyone notice slow startup after install of 10.4.9?

    Sorry to say that I haven't been on my little iBook in about a month or so, but a few nights ago updated all the software, including the 10.4.9 upgrade. Now startup is definately slower. Just wondering if anyone else was noticing this as well. 1.2/51