Formating xml data

am importing xml from a xml attribute and storing it as a
string. I am then loading it into a dynamic text box with render as
html on. The problem is formating only part of the data in the
dynamic text field as Italics or bold. I'm unable to put any
<>brackets inside the xml attribute so that it would then
render in the dynamic text field as html. I've tried using entities
and decimal equivalents as a substitute for the html mark up with
no success. How do I formate the xml node attribute with italics
and bold.
Example
<Slides>
<slideNode titlezText="This the
<i>Title</i>"></slideNode>
</slides>
This wont display. How do I italicize the word "title" when
it is inputed into a dynamic text field.

Thanks, the problem is I was trying to add the html mark up
to a xml node attribute, but it appears as tho I will have to make
this information from the node attribute be put in a new node
instead.

Similar Messages

  • Format XML data when writing to a file

    Hi,
    I am trying to write runtime data (XML) to a file. I am doign the following to write to the file:
    public void saveFile() throws Exception {
    try {
    TransformerFactory transformerFactory =
    TransformerFactory.newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    DOMSource source = new DOMSource(doc);
    OutputStream output = new FileOutputStream(XMLFile);
    StreamResult result = new StreamResult();
    transformer.transform(source, result);
    output.flush();
    output.close();
    } catch (Exception x) {
    throw x;
    The output from the above code is a clutter of elements. All the elements are on the same line some times.
    1) How can I format the output? (Indent the elements in the file)
    Is there a way to achieve this?
    Sometimes, I see a square character at the end of some lines. I thought the output file is corrupt because of this character. But it does not seem to be a problem.
    2) How do I avoid this character?

    Also, I am planning on using xpath in conjunction with DOM. However I read on one of the websites not to use too many xpath queries. I am using jdk 1.5.
    Is it tight. My code might have to be run many times. Is the following ok?
    or should I eliminate xpath and do my own traversing. I am concerned about runtime performance if I have to continue to update the xml file frequently.
    public Element getMatchingNode(MyAttributes attr) throws Exception {
    try {
    File myFile = new File(XMLFile);
    if (myFile.exists()) {
    System.out.println(XMLFile + " File exists");
    XPathFactory factory = XPathFactory.newInstance();
    XPath xPath = factory.newXPath();
    InputSource inputSource =
    new InputSource(new FileInputStream(myFile));
    String matchingString = this.getMatchingString(attr);
    Element module =
    (Element)xPath.evaluate("/" + TEST_TAG +
    "/" +
    TEST_TAG2 +
    "/" +
    DETAIL +
    matchingString,
    inputSource,
    XPathConstants.NODE);
    return module;
    } else
    return null;
    } catch (Exception x) {
    throw x;
    private String getMatchingString(MyAttributes attrs){
    StringBuffer buffer = new StringBuffer();
    for (Enumeration e=attrs.keys(); e.hasMoreElements();){
    String attribute = (String)e.nextElement();
    String value = attrs.get(attribute);
    buffer.append("[@" + attribute + "=" + "'" + value + "']");
    return buffer.toString();
    }

  • LabVIEW webservice: How to format the published XML data

    Hi,
    Im trying to  publish some measurement data with LabVIEW webservice and read the data with Android client. However i have some problems with the XML output from the LabVIEW webservice.
    I want to publish the data in in this form:
    <Response>
     -<Terminal>
            <Parameter> Temperature</Parameter>
             <Value> 5 </Value>
            <Unit> ºC </Unit>
           <Description> Measurements from Sensor 1</Description>
       </Terminal>
    </Response>
    Any ideas how i can do this? i havent found any good example on how to format the XML output this way. 

    Hi,
    You can format the data using Format Into String as shown in the attached snippet. Is this maybe something you can use?
    Willy
    Willy
    Attachments:
    format xml data.png ‏31 KB

  • Formatting XML written to a file

    Hi,
    I am trying to write runtime data (XML) to a file. I am doign the following to write to the file:
    public void saveFile() throws Exception {
    try {
    TransformerFactory transformerFactory =
    TransformerFactory.newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    DOMSource source = new DOMSource(doc);
    OutputStream output = new FileOutputStream(XMLFile);
    StreamResult result = new StreamResult();
    transformer.transform(source, result);
    output.flush();
    output.close();
    } catch (Exception x) {
    throw x;
    The output from the above code is a clutter of elements. All the elements are on the same line some times.
    1) How can I format the output? (Indent the elements in the file)
    Is there a way to achieve this?
    Sometimes, I see a square character at the end of some lines. I thought the output file is corrupt because of this character. But it does not seem to be a problem.
    2) How do I avoid this character?

    Duplicate of the following thread:
    Format XML data when writing to a file
    -Blaise

  • Not able to see iby_fd_extract_ext_pub custom tags of in XML data

    Hi Experts,
    I have customized the iby_fd_extract_ext_pub package to add the custom tags in the payment format xml data.Package status is valid but I am not able to see any of the custom element in the XML Data.
    Please share your experience if you faced similar issue.
    Regards,
    Brajesh

    1. Do not prefix it just put your code in and compile - unless you want to call XX_IBY_FD_EXTRACT_EXT_PUB from IBY_FD_EXTRACT_EXT_PUB to have minimal impact to IBY_FD_EXTRACT_EXT_PUB.
    2. You won't be able to put in an additional parameter, you'll need to derive the Payment Process Profile from SQL by linking from payment document to payment process to payment process profile; or just get the org from, say, the first invoice in the batch - as long as you always group by organization this will be fine.
    3. Yes, it is probably that a patch will overwrite your customization - make sure you test it after each IBY patch - use applcust.txt and make sure your DBA's check adpatch logs for the file being overwritten!
    Regards,
    Gareth
    http://garethroberts.blogspot.com
    http://www.virtuate.com

  • Xcelsius connectivity through XML data button

    While using XML data button, In URL Box we need an script.that will return the correctly formatted XML data source How can we do the coding of that script  and How to do its Local Hosting?
    Is there any other method or application that can be provided in the URL box so that it also returns the correctly formatted XML data source? are there some demos of it?//

    Yes, Data connection works. I can connect to Xcel, Access, xml data.
    In fact What I am trying is to do is thi:
    1 - From a user interface with some select dn list box
    2 - Use adodb connection to pull data from an access database with the selected info in the UI
    3 - format selected data as xml and load xml data into xcelsius- Run Time.
    That is quite simple with xml button but otherwise it seems difficult. I have tried different things but how to trigger the script is the problem
    Any idea?
    Thank U in advance

  • Converting Java.util date to XML date in format YYYY-MMM-dd

    I'm using below code to convert java.util.date to XML date
    public static XMLGregorianCalendar toXMLDate(Date dte) {
       try {
       // this may throw DatatypeConfigurationException
       DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
       GregorianCalendar calendar = new GregorianCalendar();
       // reset all fields
      calendar.clear();
       Calendar parsedCalendar = Calendar.getInstance();
      parsedCalendar.setTime(dte);
      calendar.set( parsedCalendar.get(Calendar.YEAR ),
      parsedCalendar.get(Calendar.MONTH),
      parsedCalendar.get(Calendar.DATE ));
       XMLGregorianCalendar xmlCalendar = datatypeFactory.newXMLGregorianCalendar( calendar );
      xmlCalendar.setTimezone( DatatypeConstants.FIELD_UNDEFINED );
      xmlCalendar.setFractionalSecond( null );
       return xmlCalendar;
    I need to get the date in the format YYYY-MMM-dd, but it returns in a format YYYY-MM-dd. Can anyone tell me how can i change the format? Thanks

    >
    The snippet of ApplicationClient where the assignment took place and the syntax occurred were:
    1. DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    2. DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
    3. Date date = new Date();
    4. CustomerDetail customerDetail = new CustomerDetail();
    5. customerDetail.setCollectionDate(dateFormat.format(date)); //got the above syntax error
    6. customerDetail.setCollectionTime(timeFormat.format(date)); //got the above syntax error
    .....I am running JDK 1.6.0_10, Glassfish v2r2, MySQL 5.0, Netbeans 6.1 on Windows XP platform.The format method returns a String not a Date. Why not just store the Date as is without formatting, and format it when you want to retrieve it from the DB and display it?
    m

  • How to convert an xml data(clob) in database to string format in bpel??

    Now I am learning SOA ,I have one scenario which I store the each record  in xml format in database  from file adapter ,extract the xml data and store the data in another  table ...Give me any suggestions which I slove these issue .
    Thanks in advance.

    Hi
    You can try the below xpath function to convert the xml into string - orcl:get-content-as-string(/xsdLocal:SAPOrderRequest)
    To convert the string back to XML - ora:parseEscapedXML(bpws:getVariableData('stringpayloadVar'))
    Regards
    Albin I

  • The file should be in XML-DATA-TEMPLATE format

    Hi,
    When I am trying to upload the Data Definition file in XML publisher with EBS 11.5.10.2, I got "The uploaded file GLPAYBDXDO.xml is invalid. The file should be in XML-DATA-TEMPLATE format". I have tried changing the file name to different names including XML-DATA-TEMPLATE but I could not succeed. I appreciate for any help.
    Thanks,
    Ram.

    What is the content of your xml file. Is this sample xml file or Data Template.

  • Change PaymentAmountText value in XML Data file of Format Payment Instructr

    How to change the value of PaymentAmountText in XML file generated during of IBY_FD_PAYMENT_FORMAT module: Format Payment Instructions?? This XML Data file is being used by the Check Print rtf template.
    The checks will be used for a Singapore$ (S$) Bank account and USD$ Bank account.
    For the S$ check in XML data file :
    <PaymentAmountText>Eighty-Five Dollars And Sixty***********************</PaymentAmountText> for S$85.60
    For the USD$ check in XML data file:
    <PaymentAmountText>Eighty-Five Dollars And Sixty Cents***********************</PaymentAmountText> for USD$85.60
    I have to add 'cents' for the value of the S$ check.
    It looks to me that since it shows for USD and not for SGD, that one can change this in some kind of set up issue. But where and how?? Or can I manipulate this value in the rtf template too??
    Edited by: user1596364 on 24-mei-2012 8:54

    I have solved my problem in following way.
    For example, I would like 'POUNDS' instead of 'DOLLARS'. Currently my check reads 1000 Dollars and 50 cents. It should read 1000 Pounds and 50 pennies
    You need to change the verbiage in the options field for the payment format. (This is the explanation for GUI users.)
    Copy your Format Payment and add some options to it to make the verbiage read Pounds and pennies. Then create a new Payment Format that uses this new Format Payment. Then put this new Payment Format on the Bank Payment Document for the bank account that needs to pay in Irish Pounds.
    1. Define a new Payment Program under System Administrator.
    Navigate to Concurrent -> Program -> Define
    Query up the Evergreen payment program you are using (ex. APXPBFEG).
    2. Click on the 'Copy to' button.
    Enter a value in the 'Program' field type, for example, "Irish Pounds Program".
    Enter a value in the 'Short name' field type, for example, "APXPBIPP".
    3. Edit the Options field in the Executable zone (Do not click the 'Parameters' button.) In the 'Options' field, enter the following 4 options on one line with one blank space between each option:
    P_UNIT_SINGULAR="Pound"
    P_UNIT_PLURAL="Pounds"
    P_SUB_UNIT_SINGULAR="penny"
    P_SUB_UNIT_PLURAL="pennies"
    (For other currencies, replace "Pound" with "Lira", "Peso",etc.)

  • Data in XML format (XML files) to BW?

    Hi,
    My customer is interested in loading data to BW (from 3rd party system) in XML format. Are there any advantages of doing this (compared to traditional ascii files)? How about disadvantages (BW version is 3.5) ?. How to get started with this one, I noticed there is a possibility to create a XML data source. Is this able to take XML files into BW or what?.
    Any help highly appreciated!

    Hi Jimmy,
       Have a look:
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/821140d72dc442e10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/55/014e3c97f6bb3ee10000000a114084/content.htm
    Hope it Helps
    Srini

  • Data template is invalid. Should be in XML-DATA-TEMPLATE format.

    Hi,
    I am trying to create & upload a Data Template for a Data Definition in XML Publisher. When I try to upload my data template, it shows me the error :-
    " The uploaded file PAFPURUP_TEMPLATE.xml is invalid. The file should be in XML-DATA-TEMPLATE format. "
    Can any please suggest me a possible resolution to this error? Below is my data template content :-
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="PAFPURUP_TEMPLATE" description="Data template for PAFPURUP" defaultPackage="PA_PAFPURUP_PKG" version="1.0">
    <parameters>
    <parameter name ="count" dataType="character" defaultValue="10"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT BUDGET_VERSION_ID, VERSION_NAME FROM PA_BUDGET_VERSIONS WHERE ROWNUM <= :count]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReport" source="PA_PAFPURUP_PKG.beforeReportTrigger"/>
    <dataStructure>
    <group name ="G_BUDGET_VERSIONS" source="Q1">
    <element name="Budget_Version_Id" value="budget_version_id"/>
    <element name="Version_Name" value="version_name"/>
    </group>
    </dataStructure>
    </dataTemplate>
    Many Thanks,
    Niranjan

    Hi Fred,
    Thanks for your response. The issue was actually with the xml format. I had missed '?' at the end of 1st line of the xml.
    Regards,
    Niranjan

  • DeleteXml() causing xml data format error in database

    Hi, guys,
      I'm using the oracle  xml db 11g in my website application. Last week I found that using the deletexml() to delete a node in the xml may cause a terrible problem that the rest data in the database had wrong xml format. I wonder is it a bug when using binary xml storage.
      My xml data is describe below,
    <root>
         <nodes>
              <node id="1">
                   <name>John</name>
                   <age>16</age>
                   <hobby>football</hobby>
              </node>
              <node id="2">
                   <name>Alex</name>
                   <age>22</age>
                   <hobby>table tenisl</hobby>
             </node>
         <nodes>
    </root>
      I using deletexml() to delete just a node once time,
    "update projects set object_value=deletexml(object_value, '/root/nodes/node[@id="1"]')"
    Usually it successes and the rest data is as excepted, but sometime, I find that after deleting a node, any query in the database except "select * from projects" gets null. And the rest data has wrong format like below,
    <root>
         <nodes>
              <node id="1">
                   <name>John</name>
                   <age>/hobby>
              </node>
              <node id="2">
                   <name>Alex</name>
                   <age>22</age>
                   <hobby>table tenisl</hobby>
             </node>
         <nodes>
    </root>
    Just one format error causes the whole xml data valueless, but it seems that in most time the deletexml() works well, does anyone knows what happens?
    Thanks a lot.

    KnightOfBlueArmor wrote:
    The better idea is to use XMLPatch() if you can.
    XMLPatch?
    Do you use it yourself on a regular basis?
    Personally, I find it fun to use but the performance doesn't match my expectations (no piecewise update/streaming eval AFAIK).
    Message was edited by: odie_63

  • Help retreiving XML data in table format

    Hello,
    i have a field which stores IP and Domain data in XML format. The field data type is BLOB.
    here is the XML data sample stored in the field.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <DOMAIN Name="DOMAIN_NAME HERE">
    <IPADDRESS Address="X.X.X.X1"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X2"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X3"></IPADDRESS>
    <IPADDRESS Address="X.X.X.X4"></IPADDRESS>
    ... ETC
    Is it possible to run SELECT against this field and retrieve the data in the table format, so the output will have two fields and look like
    domain IPADDRESS
    DOMAIN_NAME HERE X.X.X.X1
    DOMAIN_NAME HERE X.X.X.X2
    DOMAIN_NAME HERE X.X.X.X3
    DOMAIN_NAME HERE X.X.X.X4
    I have tried many option with Extract, extractvalue and XMLQuery, not luck.
    Thank you very much!
    Sergei

    Try...
    xp20:format-dateTime(string($dateFromDatabase), '[D01]-[MN,*-3]-[Y0001] [H01]:[m01] P')Ref
    http://www.w3.org/TR/xslt20/#function-format-dateTime
    Cheers,
    Vlad

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

Maybe you are looking for

  • 1520 texting and facebook notifications

    I'm only getting my text messages once a day sometimes twice and my Facebook notifications I get tons of them at one time a day. Do I have something wrong in my settings or is it the phone?

  • CAHeadless has encountered an error.

    [/Adobe/premiere/elements/Release/12/ALL_LANG_12.1/MediaCore/Backend/Make/Mac/../../Src/Se quence/Sequence.cpp-2233] this is the problem I have

  • Windows "Regional Options" locale - JCE for 8bit vs 16bit character sets

    I have a Java application that reads in an Encrypted text file. The text file was Encrypted using JCE 1.2.1 and Encrypted on a Windows system with the locale set to English(US). The Encryption uses Sun's version of the DES encryption algorithm. This

  • Changing a jsp in application

    I have a java web application that is running on Sun's web server for a few years. It consists of jsp pages. In one of the jsp pages, there is a string for database. The database location and name is changing. I can change the jsp page in notepad wit

  • My photos have stopped uploading to my pc/photostream.

    Photos were uploading until 10/2013, then just stopped.   I have seen several posts regarding this problem and tried a few solutions.  Most recently, signing out an back into to iCloud, but no results.