Change query string in ireport xml file?

greetings all
iam newbie to xml
first i want to add the xml file to a packge named first,how to do that?
second i want to change the query string to be
"select * from report where month= "+textfield.getText()
here's the code:
<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
           name="Untitled_report_2"
           columnCount="1"
           printOrder="Vertical"
           orientation="Portrait"
           pageWidth="595"
           pageHeight="842"
           columnWidth="535"
           columnSpacing="0"
           leftMargin="30"
           rightMargin="30"
           topMargin="20"
           bottomMargin="20"
           whenNoDataType="NoPages"
           isTitleNewPage="false"
           isSummaryNewPage="false">
     <property name="ireport.scriptlethandling" value="0" />
     <property name="ireport.encoding" value="UTF-8" />
     <import value="java.util.*" />
     <import value="net.sf.jasperreports.engine.*" />
     <import value="net.sf.jasperreports.engine.data.*" />
     <queryString><![CDATA[SELECT * FROM report]]></queryString>
     <field name="category" class="java.lang.String"/>
     <field name="values" class="java.lang.Integer"/>
     <field name="series" class="java.lang.String"/>
          <background>
               <band height="0"  isSplitAllowed="true" >
               </band>
          </background>
          <title>
               <band height="0"  isSplitAllowed="true" >
               </band>
          </title>
          <pageHeader>
               <band height="0"  isSplitAllowed="true" >
               </band>
          </pageHeader>
          <columnHeader>
               <band height="0"  isSplitAllowed="true" >
               </band>
          </columnHeader>
          <detail>
               <band height="201"  isSplitAllowed="true" >
                    <stackedBar3DChart>
                         <chart  hyperlinkTarget="Self" >
                         <reportElement
                              x="32"
                              y="21"
                              width="394"
                              height="144"
                              key="element-1"/>
                         <box></box>
                              <chartLegend textColor="#000000" backgroundColor="#FFFFFF" >
                         </chartLegend>
                         </chart>
                         <categoryDataset>
                              <dataset >
                              </dataset>
                              <categorySeries>
                                   <seriesExpression><![CDATA[$F{series}]]></seriesExpression>
                                   <categoryExpression><![CDATA[$F{category}]]></categoryExpression>
                                   <valueExpression><![CDATA[$F{values}]]></valueExpression>
                    <itemHyperlink >
                    </itemHyperlink>
                              </categorySeries>
                         </categoryDataset>
                         <bar3DPlot >
                              <plot />
                              <categoryAxisFormat>
                                   <axisFormat >
                                   </axisFormat>
                              </categoryAxisFormat>
                              <valueAxisFormat>
                                   <axisFormat >
                                   </axisFormat>
                              </valueAxisFormat>
                         </bar3DPlot>
                    </stackedBar3DChart>
               </band>
          </detail>
          <columnFooter>
               <band height="3"  isSplitAllowed="true" >
               </band>
          </columnFooter>
          <pageFooter>
               <band height="0"  isSplitAllowed="true" >
               </band>
          </pageFooter>
          <summary>
               <band height="0"  isSplitAllowed="true" >
               </band>
          </summary>
</jasperReport>

the xml file
<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
           name="test"
           columnCount="1"
           printOrder="Vertical"
           orientation="Portrait"
           pageWidth="595"
           pageHeight="842"
           columnWidth="535"
           columnSpacing="0"
           leftMargin="30"
           rightMargin="30"
           topMargin="20"
           bottomMargin="20"
           whenNoDataType="NoPages"
           isTitleNewPage="false"
           isSummaryNewPage="false">
     <property name="ireport.scriptlethandling" value="0" />
     <property name="ireport.encoding" value="UTF-8" />
     <import value="java.util.*" />
     <import value="net.sf.jasperreports.engine.*" />
     <import value="net.sf.jasperreports.engine.data.*" />
     <queryString><![CDATA[SELECT * FROM report WHERE category BETWEEN 'week1' AND 'week4']]></queryString>
     <field name="category" class="java.lang.String"/>
     <field name="values" class="java.lang.Integer"/>
     <field name="series" class="java.lang.String"/>
          <background>
               <band height="0"  isSplitAllowed="true" >
               </band>
          </background>
          <title>
               <band height="50"  isSplitAllowed="true" >
                    <staticText>
                         <reportElement
                              x="158"
                              y="7"
                              width="183"
                              height="37"
                              key="staticText-1"/>
                         <box></box>
                         <textElement>
                              <font size="14"/>
                         </textElement>
                    <text><![CDATA[               Report]]></text>
                    </staticText>
               </band>
          </title>
          <pageHeader>
               <band height="50"  isSplitAllowed="true" >
               </band>
          </pageHeader>
          <columnHeader>
               <band height="30"  isSplitAllowed="true" >
               </band>
          </columnHeader>
          <detail>
               <band height="4"  isSplitAllowed="true" >
               </band>
          </detail>
          <columnFooter>
               <band height="2"  isSplitAllowed="true" >
               </band>
          </columnFooter>
          <pageFooter>
               <band height="0"  isSplitAllowed="true" >
               </band>
          </pageFooter>
          <summary>
               <band height="194"  isSplitAllowed="true" >
                    <stackedBar3DChart>
                         <chart  hyperlinkTarget="Self" >
                         <reportElement
                              x="49"
                              y="-6"
                              width="369"
                              height="200"
                              key="element-1"/>
                         <box></box>
                              <chartLegend textColor="#000000" backgroundColor="#FFFFFF" >
                         </chartLegend>
                         </chart>
                         <categoryDataset>
                              <dataset >
                              </dataset>
                              <categorySeries>
                                   <seriesExpression><![CDATA[$F{series}]]></seriesExpression>
                                   <categoryExpression><![CDATA[$F{category}]]></categoryExpression>
                                   <valueExpression><![CDATA[$F{values}]]></valueExpression>
                    <itemHyperlink >
                    </itemHyperlink>
                              </categorySeries>
                         </categoryDataset>
                         <bar3DPlot >
                              <plot />
                              <categoryAxisFormat>
                                   <axisFormat >
                                   </axisFormat>
                              </categoryAxisFormat>
                              <valueAxisFormat>
                                   <axisFormat >
                                   </axisFormat>
                              </valueAxisFormat>
                         </bar3DPlot>
                    </stackedBar3DChart>
               </band>
          </summary>
</jasperReport>the java code:
import java.sql.*;
import net.sf.jasperreports.view.JasperViewer;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.JasperReport;
import java.io.OutputStream;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class ReportDriver {
public static void createAndShowGUI(){
Object[]obj={"1","2"};
JComboBox combo=new JComboBox(obj);
JFrame frame=new JFrame("Test");
JButton button=new JButton("Show Report");
frame.setLayout(new FlowLayout());
frame.setLocationRelativeTo(null);
frame.add(combo);
frame.add(button);
frame.setSize(150,100);
frame.setVisible(true);
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
show_report();     
public static void show_report(){
try{
         Class.forName("com.mysql.jdbc.Driver");
         Connection c = DriverManager.getConnection("jdbc:mysql://localhost/library", "root", "");
      }catch(Exception ex) {ex.printStackTrace();}
      try{
         JasperDesign jasperDesign = JRXmlLoader.load("F:\\Program Files\\Xinox Software\\JCreatorV4\\MyProjects\\chart2\\src\\report.xml");
         JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
         Connection c = DriverManager.getConnection("jdbc:mysql://localhost/library", "root", "");
         JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, c);
         JasperViewer.viewReport(jasperPrint);
      }catch(Exception ex) {
         String connectMsg = "Could not create the report " + ex.getMessage() + " " + ex.getLocalizedMessage();
         System.out.println(connectMsg);
   public static void main(String[] args) {
    createAndShowGUI();
}the problem is i want when the user selects 2 from the combobox and presses the button
the where clause in the xml file is changed to BETWEEN 'week5' AND 'week8',how to do that?

Similar Messages

  • How can I parse an XML string, (not an XML file)?

    Hi,
    I am using Xerces2 Java Parser 2.4.0,
    I wanta parse an XML string, not an XML file, but
    in the Parser class there is only following methods:
    parse(InputSource source)
    parse(java.lang.String systemId)
    thanks

    hi
      InputSource is = new InputSource(new ByteArrayInputStream(xmlSrc.getBytes()));
      HTH
    vasanth-ct

  • How can I change the name of the XML file which is submitted by mail?

    Hello Everybody,
    If I submit my pdf file as XML
    I will get something like this:
    MyFile.PDF -> submit as XML -> MyFile_data.XML
    My problem is with the _data at the end of the file name -> this addition is coming from the windows logon language,
    I know that because if the windows logon is in spanish I get the addition _datos for example: MyFile_datos.XML
    Is there a way to change the name of the xml file for example : MyFile.XML
    Thank you all in advance,
    Eran

    Hello Uti,
    I found out it is something with the adobe reader installation.
    If it is in English the suffix is _data
    If it is in Spanish the suffix is _datos
    If it is in Hebrew the suffix is _נתונים
    So Now I think i will have to open OSS for this issue.
    Thank you so much for your reply - I thought i was the only one with this problem...
    Best Regards,
    Eran

  • I have 100 groups in planning for those 100 groups i want to build roles like interactive,view user,planner etc.for those how to change in export -import folder .xml file  in that edit  how  to change user roles in that xml it will generate automatic id.h

    I have 100 groups in planning for those 100 groups i want to build roles like interactive,view user,planner etc.for those how to change in export -import folder .xml file  in that edit  how  to change user roles in that xml it will generate automatic id.how to do that in xml file ?

    Thanks john for you are reply.
    I had tried what you sad.I open shared service in that foundation project i had export shared service.after that in import-export file.In that role.csv,user.csv,group.csv.Like this file have.When i open user file added some users after i trying save in excel it shown messgse
    I click yes and save the .csv file and import from share servie. i got error like this
    am i doing right way john.or explain clearly

  • How to change the attributes of an XML file

    hi peeps 'ope you can help me here i need to change the attributes of an xml file, i parse it first using a DOM parser but i cant find a way to change the attributes in the XML file, setAttribute() works only at runtime and doesn't change the attribute in the file itself. I can't find a method that will answer my question. I've searched through the forum and found similar threads....they say in order to write and change the attribute i must use the write() method of the XmlDocument class defined in com.sun.xml.tree.XmlDocument. But, i found another thread, and it says that com.sun.xml.tree.XmlDocument is not safe to use and i should use org.apache.crimson.tree.XmlDocument.....i can't find the XmlDocument class and the API for this package so i really dont know where to start...hope you guys can help me! thnx

    thanks for responding roland....i already found the solution...i didn't use the XmlDocument class because i can't find any documents about it except for JAXP 1.0 here is my code snippet...i used the TransformerFactory and Transformer class to write
    import org.w3c.dom.*;
    import org.w3c.dom.traversal.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    Document doc = null;
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    dbf.setValidating(false);
    doc = db.parse(fileGetFile); //this is the XML file
    n1 = (Node)doc.getDocumentElement();
    e1 = (Element) n1;
    NodeList nodeList = doc.getElementsByTagName ("File");
    //just insert whatever you want to do with the XML...parse it..set/change the attribute..etc....sample snippet below changes the attribute downloaded to "no"
    for(int iWriteFailed = 0; iWriteFailed <nodeList.getLength() ; iWriteFailed ++){     
    n2 = nodeList.item(iWriteFailed);
    e2 = (Element) n2;          
    e2.setAttribute("downloaded", "no");}
    try{
    TransformerFactory transformerFactory = TransformerFactory.newInstance();
    Transformer transformer = transformerFactory.newTransformer();
    transformer.transform(new DOMSource(doc), new StreamResult ( new FileOutputStream ( fileGetFile) ) );}
    catch(Exception trans){}
    thanks for responding and keeping the information interchange alive here in the forum...
    Pau

  • Getting an error while changing a tag in an XML file

    Hi,
    When I am trying to replace the existing XML tag with other one I am getting the following exception:
    org.w3c.dom.DOMException: NOT_FOUND_ERR: An attempt is made to reference a node in a context where it does not exist.
    at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source)
    at org.apache.xerces.dom.ParentNode.replaceChild(Unknown Source)
    at org.apache.xerces.dom.CoreDocumentImpl.replaceChild(Unknown Source)
    at com.Replace_Tag.replaceNode(Replace_Tag.java:97)
    at com.Replace_Tag.processRequest(Replace_Tag.java:39)
    at com.Replace_Tag.doGet(Replace_Tag.java:56)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
    The following is the code I am using :
    public void replaceNode() throws Exception{
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document doc = db.parse("file:/C:/Documents and Settings/srikanth.d.KNOAHSOFT/Desktop/Linechart.jrxml");
            Element root = doc.getDocumentElement();
            Element newElement = doc.createElement("stackedBarchart");
            NodeList oldList = root.getElementsByTagName("lineChart");
            int length = oldList.getLength();
            System.out.println("length::"+length);
            for(int i=0;i<length;i++)
                Node oldNode = oldList.item(i);
                NodeList nl = doc.getChildNodes();
    newElement.getTagName().toString());                   
    (i).getNodeName().toString());
                doc.replaceChild((Node)newElement, oldNode);           
    Can anybody help me in this regard...
    Thanks and Regards
    DNV Srikanth

    i am posting the xml file also :
    <?xml version="1.0" encoding="UTF-8"  ?>
    <!-- Created with iReport - A designer for JasperReports -->
    <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
    <jasperReport
               name="Line chart"
               columnCount="1"
               printOrder="Vertical"
               orientation="Portrait"
               pageWidth="396"
               pageHeight="842"
               columnWidth="396"
               columnSpacing="0"
               leftMargin="0"
               rightMargin="0"
               topMargin="0"
               bottomMargin="0"
               whenNoDataType="NoPages"
               isTitleNewPage="false"
               isSummaryNewPage="false">
         <property name="ireport.scriptlethandling" value="2" />
         <property name="ireport.encoding" value="UTF-8" />
         <import value="java.util.*" />
         <import value="net.sf.jasperreports.engine.*" />
         <import value="net.sf.jasperreports.engine.data.*" />
         <queryString><![CDATA[select * from evalsubcomparison where qacount1 between 70.0 and 75.0]]></queryString>
         <field name="EmpId" class="java.lang.Double"/>
         <field name="Empname" class="java.lang.String"/>
         <field name="BaseEmpId" class="java.lang.Double"/>
         <field name="QACount1" class="java.lang.Double"/>
         <field name="WeekId1" class="java.lang.String"/>
         <field name="QACount2" class="java.lang.Double"/>
         <field name="WeekId" class="java.lang.String"/>
         <field name="QACount3" class="java.lang.Double"/>
         <field name="WeekId3" class="java.lang.String"/>
         <field name="QACount4" class="java.lang.Double"/>
         <field name="WeekId4" class="java.lang.String"/>
         <field name="level" class="java.lang.Double"/>
              <background>
                   <band height="0"  isSplitAllowed="true" >
                   </band>
              </background>
              <title>
                   <band height="0"  isSplitAllowed="true" >
                   </band>
              </title>
              <pageHeader>
                   <band height="0"  isSplitAllowed="true" >
                   </band>
              </pageHeader>
              <columnHeader>
                   <band height="0"  isSplitAllowed="true" >
                   </band>
              </columnHeader>
              <detail>
                   <band height="0"  isSplitAllowed="true" >
                   </band>
              </detail>
              <columnFooter>
                   <band height="0"  isSplitAllowed="true" >
                   </band>
              </columnFooter>
              <pageFooter>
                   <band height="0"  isSplitAllowed="true" >
                   </band>
              </pageFooter>
              <summary>
                   <band height="301"  isSplitAllowed="true" >
                        <lineChart>
                             <chart  hyperlinkTarget="Self" >
                             <reportElement
                                  mode="Opaque"
                                  x="0"
                                  y="0"
                                  width="390"
                                  height="300"
                                  backcolor="#FFFFFF"
                                  key="element-1"/>
                             <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
                                  <chartLegend textColor="#000000" backgroundColor="#FFFFFF" >
                             <font fontName="Times New Roman" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false" pdfEncoding="Cp1252"/>
                             </chartLegend>
                             </chart>
                             <categoryDataset>
                                  <dataset >
                                  </dataset>
                                  <categorySeries>
                                       <seriesExpression><![CDATA["WE "+$F{WeekId1}]]></seriesExpression>
                                       <categoryExpression><![CDATA[$F{Empname}]]></categoryExpression>
                                       <valueExpression><![CDATA[$F{QACount1}]]></valueExpression>
                        <itemHyperlink >
                        </itemHyperlink>
                                  </categorySeries>
                                  <categorySeries>
                                       <seriesExpression><![CDATA["WE "+$F{WeekId}]]></seriesExpression>
                                       <categoryExpression><![CDATA[$F{Empname}]]></categoryExpression>
                                       <valueExpression><![CDATA[$F{QACount2}]]></valueExpression>
                        <itemHyperlink >
                        </itemHyperlink>
                                  </categorySeries>
                                  <categorySeries>
                                       <seriesExpression><![CDATA["WE "+$F{WeekId3}]]></seriesExpression>
                                       <categoryExpression><![CDATA[$F{Empname}]]></categoryExpression>
                                       <valueExpression><![CDATA[$F{QACount3}]]></valueExpression>
                        <itemHyperlink >
                        </itemHyperlink>
                                  </categorySeries>
                                  <categorySeries>
                                       <seriesExpression><![CDATA["WE "+$F{WeekId4}]]></seriesExpression>
                                       <categoryExpression><![CDATA[$F{Empname}]]></categoryExpression>
                                       <valueExpression><![CDATA[$F{QACount4}]]></valueExpression>
                        <itemHyperlink >
                        </itemHyperlink>
                                  </categorySeries>
                             </categoryDataset>
                             <linePlot >
                                  <plot backcolor="#FFFFFF" />
                                  <categoryAxisFormat>
                                       <axisFormat >
                                       </axisFormat>
                                  </categoryAxisFormat>
                             <valueAxisLabelExpression><![CDATA["No. of Evaluations"]]></valueAxisLabelExpression>
                                  <valueAxisFormat>
                                       <axisFormat >
                                            <labelFont>
                             <font fontName="Serif" pdfFontName="Helvetica" size="14" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false" pdfEncoding="Cp1252"/>
                                            </labelFont>
                                            <tickLabelFont>
                                            </tickLabelFont>
                                       </axisFormat>
                                  </valueAxisFormat>
                             </linePlot>
                        </lineChart>
                   </band>
              </summary>
    </jasperReport>can anybody pls help me in this regard......

  • Query in a large xml file

    Hello,
    I'm trying to work with very large xml files which are created from csv files. These files may be very large - up to 1 GB ! Untill now I have managed to do several validations on these big xml files, and the only thing that works for me is SAX parser, DOM is out of the question because it fills up memory.
    My next task is to do queries on these files, smth like:
    select field1,field2 from file.xml
    where field3 = 'A'
    and (fileld4>'B' or field1='C')
    order by field2.
    I searched the net about finding out how to make queries on xml files (since I have never done queries on xml before), but I couldn't find which "query language" is best for large files. If I use XPath (XSLT) will that not cause me memory problems because XSLT represents the file as a memory object?
    My idea is to parse the file with SAX and check every row if it fits the where condition and then write it immediately to a result xml file. But validating the where statement can be very complicated without using some tool. Also the order by statement is another problematic issue.
    Does anyone have some more intelegent ideas about how I can do this? Please help! :(
    The xml file looks like this:
    <doc>
    <row id ="1">
    <column id="1" name="column1">value</column>
    <column id="N" name="columnN">value</column>
    </row>
    <row id ="M">
    <column id="1" name="column1">value</column>
    <column id="N" name="columnN">value</column>
    </row>
    </doc>

    Hi all,
    Thank you very much for your replies.
    First, saxon didn't work because it uses an in-memory parser, and that is what I was trying to avoid.
    Different database is also out of the question, because the customer insist on XML, and also there are some files that can never be converted to a database table, because eventually with some transformations thay are changed and are not completely like the standard csv format.
    I think that maybe http://exist.sourceforge.net is the rigth solution for me, but I will probably try it in the next version of my project.
    For now I have managed to make the project with only SAXParser and a lot of back - end programming and it works ok, althoug it was very hard to make it, and will be harded to maintain, so I will try to look at the eXist project.
    Thanks everyone for the help.

  • Downloading the string as an XML file

    I tried to download a string stored in session to be downloaded as a XML file. I am able to download the file. But the problum I am getting space at the top of the file
    The code I used is like
    <%
    String xmlContent = xmlContent.trim();
         SAXBuilder builder = new SAXBuilder();
         Document doc = builder.build(new ByteArrayInputStream(xmlContent.getBytes()));
         XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
         //response.setContentType("APPLICATION/XML");
         response.setContentType( "application/xml" );
         response.setHeader("Content-Disposition","attachment; filename=\""+ fileName+"" + "\""+"");
         try{
              //outputter.output(doc,System.out);
              outputter.output(doc,out);
              //outputter.o
         catch(Exception e){
              System.out.println("Exception while displaying config request data "+ e);
    %>
    the output has spaces above the xml prolog. Can anybody help me in solving this issue.
    Thank you.

    I have designed an application that uses XML
    as the storage instead of database.Ok.
    I think searching for a particular element in an XML
    file is complex, and other than that I am not seeing
    any problem.You could abstract that complexity away behind an Adapter.
    So I need u guys view points on this
    "usage of data in an XML file".It depends on the nature and format of that to determine if it's a good idea. You need to consider a number of factors when deciding how to persist data. How much data is there, how often does the format and/or semantics of that data change, how is the data presented or processed. What is the lifetime of that data, what is the ratio of writes to reads. what is the access scope of the data, how secure does the data need to be.
    Finding the most appropriate format for data is oten more important than finding the most appropriate algorithm for a program, since data often has a longer life time that the programs that access it.

  • Change font size in an XML file

    I bought a template and this page is the text on the opening
    page. The Title is bold and a bigger font than the next paragraph
    and the first line of the data is what I really want in the tittle
    but the line is a bit to long so I'm looking to change the size of
    the font. I see no code that makes the tittle bold and a bigger
    text so i'm thinking it must be tied to the template. Please if
    someone can help I would be greatly appreciated.
    It's been 15 years since I messed with a web page. Also one
    last question. Look at my site dkdaniels.com and the bottom of the
    first page left side where copyright is at there is a file called
    settings.xml and there is a place to change that info which I did,
    but also on the right it sasy designed by and your suppose to be
    able to imput your name and I see no such info in the settings file
    so does anyone know where one can edit that?
    Many Thanks
    DK

    .oO(dkdaniels)
    >I bought a template and this page is the text on the
    opening page. The Title is
    >bold and a bigger font than the next paragraph and the
    first line of the data
    >is what I really want in the tittle but the line is a bit
    to long so I'm
    >looking to change the size of the font. I see no code
    that makes the tittle
    >bold and a bigger text so i'm thinking it must be tied to
    the template. Please
    >if someone can help I would be greatly appreciated.
    An XML file alone is pretty useless. For the Web there
    usually has to be
    a script or a stylesheet to turn the XML into HTML which a
    browser can
    understand. So check that stylesheet or whatever else there
    might be.
    > It's been 15 years since I messed with a web page. Also
    one last question.
    >Look at my site dkdaniels.com and the bottom of the first
    page left side where
    >copyright is at there is a file called settings.xml and
    there is a place to
    >change that info which I did, but also on the right it
    sasy designed by and
    >your suppose to be able to imput your name and I see no
    such info in the
    >settings file so does anyone know where one can edit
    that?
    There's no content on that site. All I get is a blank/black
    page.
    Micha

  • How to change the output directory of .xml files

    Hi,
    There are lots of .xml files generated under
    $ORACLE_AS_HOME/j2ee/home/applications/xmlpserver/xmlpserver/xml.
    (ex:/usb/bipub3/oracle/oc4j_bi/j2ee/home/applications/xmlpserver/xmlpserver/xml).
    I found these files are generated in the following operation;
    1.Log in BI Publisher.
    2.Select the Schedules tab.
    I think they are kind of temp files so we will be able to delete them.
    But I'd like to know how to change the output directory.
    Can we change the above directory to other path?
    Regards.

    Why? As that may invalidate support since you configure/alter the deployment.
    The location is specified in oc4j_bi\j2ee\home\applications\xmlpserver\xmlpserver.war, so you could go into the war file and alter it.

  • A query while  importing  an XML file into a Database Table

    Hi,
    I am Creating an ODI Project to import an XML file into a Database Table.With the help of the following link
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_xml-to-table/odi_project_xml-to-table.htm
    I am facing a problem while creating Physical Schema for the XML Source Model.
    For the
    Schema(Schema)
    and
    Schema(Work Schema) field they have selected GEO_D.
    What is GEO_D here??
    or
    What I have to select here?
    1) schema of the xml file (NB:-I havn't created any .xsd or .dtd file for my .xml file)
    or
    2)my target servers schema
    Please tell me what I'll do??
    Thanks

    and
    Schema(Work Schema) field they have selected GEO_D.
    What is GEO_D here??This is the schema name which is specified in the XML file .
    What I have to select here?
    1) schema of the xml file (NB:-I havn't created any .xsd or .dtd file for my .xml file)Yes
    2)my target servers schema
    Please tell me what I'll do??
    Thanks

  • Bug: APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B changes Query-String

    Hi APEX Dev Team,
    I found a bug (or unexpected behaviour i don't know how to work around) in APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B. I think it also applies to CREATE_COLLECTION_FROM_QUERY.
    What is happening: certain strings are replaced in the query i pass into the function. e.g. '%22' is replaced with a blank. This isn't good if i have a query like this:
    SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%22306%';This returns zero rows in the collection. If i execute this query in SQL Developer it returns 5 rows.
    When i change the statment to the following, it returns the 5 rows in the collection.
    SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%2306%';Trace shows me, that the first SELECT is changed to
    SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE ' 306%';Which is obviously wrong :-)
    The changes seem to be limited to %22, i didn't find any other URL-encoding characters that are replaced in the query.
    Please fix, as i can't find any workaround.
    thanks,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

    Hi Peter,
    Thank you for reporting this. This seems to be some legacy logic which is no longer necessary (the logic replaced the string '%22'). I have fixed this for Application Express 4.1.
    As a workaround, you may wish to concatenate this specific string in your query, which will let you avoid this logic. E.g.,
    SELECT MYCOLA, MYCOLB, MYCOLC FROM MYTABLEA WHERE MYPHONE LIKE '%2' || '2306%';
    Thanks again.
    Joel

  • How to perform a query to read an xml file in SCCM 2007

    Good,
    I need read knows how to read an csv file for a specific column after collecting the results, then put the PC's in a collection in particular.
    A greeting and thanks

    Good,
    What I want to do is create a query that examine a csv that is on a server. And after consideration and select the column that I am interested
    in(Name pc) be able to engage these data to a collection, clear is if it can be done in SCCM 2007
    A greeting and thanks

  • Binary I/O: Changing a String inside a Binary File

    Hi people, good morning!
    I have written a method here which takes two files as parameters. The method opens the first file (which may or may not be binary) using FileInputStream, loading it into a byte array. This byte array is converted to String by a CharsetDecoder (ISO-8859-1 encoding) and then i use indexOf() on this String to find the initial position of the token i need to find.
    Then, i transform the replaced token with getBytes() and insert it in the same position as the index found above, writing everything to the second file parameter as bytes to a FileOutputStream.
    The problem is that the destination file, when opened with the associated program (Eg: Oracle Forms Builder for *.fmb files) says the file is corrupt. Seeing that the original file opens and compiles normally, i believe the substitution process is corrupting the file.
    Do you know what my code below is missing? Strangely enough, when the replaced token is not larger than the original token, the file is not corrupted...
    Any help is greatly appreciated.
    Regards!
    Thiago Souza
              FileInputStream in = null;
              FileOutputStream out = null;
              try {
                   File f = new File(nameFrom);
                   in = new FileInputStream(f);
                   byte b[] = new byte[(int) f.length()];
                   in.read(b);
                   Charset cs = Charset.forName("ISO-8859-1");
                   CharsetDecoder cd = cs.newDecoder();
                   CharsetEncoder ce = cs.newEncoder();
                   byte[] headerChange = "$Header: MDBFNDENABLEEVENTS.fmb 115.1 2006/08/10 10:00:00 appldev ship $".getBytes();
                byte[] headerBytes  = "$Header: %f% %v% %d% %u% ship $".getBytes();
                   String header       = cd.decode(ByteBuffer.wrap(headerBytes)).toString();
                   int headerExcess      = headerChange.length - headerBytes.length;
                   header: for (int counter = 0; counter < 30; counter++) {
                        String fileContents = cd.decode(ByteBuffer.wrap(b)).toString();
                        int index = fileContents.indexOf(header);
                        if (index < 0) break header;
                         int headerEnd = index + headerBytes.length;
                         int endChunk = b.length - headerEnd;
                         byte[] initArray  = new byte[index];
                         System.arraycopy(b, 0, initArray, 0, index);
                         byte[] finalArray = new byte[endChunk];
                         System.arraycopy(b, headerEnd, finalArray, 0, endChunk);
                         b = new byte[b.length + headerExcess];
                         System.arraycopy(initArray, 0 , b, 0, index);
                         System.arraycopy(headerChange, 0 , b, index, headerChange.length);
                         System.arraycopy(finalArray, 0, b, headerEnd + headerExcess, endChunk);
                   } //Final FOR
                   out = new FileOutputStream(new File(nameTo));
                   out.write(b);
                   out.flush();
               } finally {
                    if (out != null) out.close();
                    if (in != null) in.close();
               }

    If the file is binary, converting it into a String is not a reversible operation and you will definitely get data corruption. You need to work directly in bytes.

  • How to pass a XML message as a string and to change the string back to XML

    Hi there,
    in our current application, we have to access a webservice with a message whose XML Schema Definition was provided by the service's provider. But when accessing the webservice's WSDL, it says that the service expects the message part as a string type.
    How can I accomplish to send this structured message (as defined by the .XSD) to the webservice as a string?
    Thanks in advance,

    Michal,
    thanks very much for your help!
    I've managed to correctly serialize a xml into a string with the tips in your blog. However, I've not managed to perform the string -> xml (unserialize) step (I'm using Udo's sugestion).
    The problem is that XI generates a namespace prefix in runtime (it can be ns0, ns1, ns2..., depending on the context), and so I need to reference this namespace into the unserializing XSLT. With XMLSpy, I've managed to correctly transform it using the XPath "//*:my_tag" to the string tag, but this approach didn't work in XI.
    If I try to use just "//my_tag" the transformation concludes successfully, but XI says that the generated XML is not well-formed (probably because it doesn't fits the Schema of the target message, but I'm just guessing here). If I try to use "//:*my_tag", it doesn't even performs the transformation, and gives a "Problem When Testing" error, which says "Transformer configuration exception occurred when loading XSLT ...".
    Any ideas on how to reference namespace prefixes in XSLTs in XI?
    The codes of my XSLT's are below:
    XML to string:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <my_tag>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>
    <xsl:copy-of select="/"/>
    <xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>
    <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </my_tag>
    </xsl:template>
    </xsl:stylesheet>
    String to XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my_prefix="http://my_namespace">
    <xsl:template match="/">
    <xsl:for-each select="//*:my_tag">
    <xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Thanks again!

Maybe you are looking for