Read value of DateTimeInput XML View in YYYYMMDD format

Dear Experts,
I am using DateTimeInput in my XML view as:
<DateTimeInput id="FromDate" type= "Date" placeholder="Enter Date ..."  />
And reading the value in the controller as:
var oParameters = { "fdate" : sap.ui.getCore().getElementById('FromDate').getValue() };
Now,  the date value I get is 8/7/14 from iPhone and 07/08/2014 for Android devices for date 07, Aug 2014.
I want the date value in YYYYMMDD format like 20140807.  I have tried using the parameter displayFormat and locale, but the display format changes and the value remains the same.
Request you to please suggest on how can I get the date value in YYYYMMDD format.
Warm regards,
Upendra Agrawal

So, the display value is ok, but you want the actual value to be YYYYMMDD as well (i.e. regardless of the display value)?
Have you tried using both valueFormat="yyyyMMdd" displayFormat="yyyyMMdd" ?
First convert your dates to yyyyMMdd format, and then using both valueFormat and displayFormat it then correctly expects the date to be supplied in format yyyyMMdd

Similar Messages

  • How to read values from the following XML?

    I have been using "extractValue" to get the values from a xmltype field and no problems until now.
    The xmltype now is like:
    <a>1</a>
    <b>2</b>
    <c>1221</c>
    <c>1412</c>
    <d>11111</d>
    <e>3333</e>
    I'm able to read values from 'a,b,d,e' but not from 'c'.
    Questions:
    1)- Is posible to read the values of field c?. How?
    2)- If is not posible to read the field values, Is posible to transfor the xmlfield to:
    Where I will be able to use xmltable columns and loop getting the values.
    <a>1</a>
    <b>2</b>
    <k>
    <c>1221</c>
    <c>1412</c>
    </k>
    <d>11111</d>
    <e>3333</e>
    Like always
    Thank you in advance for your help.
    Jose Galan

    SQL> with XML as
      2  (
      3   select xmltype(
      4  '<root>
      5    <a>1</a>
      6    <b>2</b>
      7    <c>1221</c>
      8    <c>1412</c>
      9    <d>11111</d>
    10    <e>3333</e>
    11  </root>'
    12  ) XMLDOC
    13    from dual
    14  )
    15  select a, b,c, d, e
    16    from XML,
    17         XMLTABLE
    18         (
    19            '/root'
    20            passing XMLDOC
    21            columns
    22            A number(5) path 'a',
    23            B number(5) path 'b',
    24            D number(5) path 'd',
    25            E number(5) path 'e',
    26            C_XML_FRAG xmltype path 'c'
    27         ),
    28         XMLTABLE
    29         (
    30           '/c'
    31           passing C_XML_FRAG
    32           columns
    33           C number(5) path '.'
    34         )
    35  /
             A          B          C          D          E
             1          2       1221      11111       3333
             1          2       1412      11111       3333
    SQL>

  • Error in Reading data from a xml file in ESB

    Hi,
    i created a inbound file adapter service which reads data from a xml file and passes it to the routing service and from there updates to the database.....
    (everything created in jdeveloper)
    But i am getting error....it is not getting updated to the database...when i check the database(select * from table) its showing one row selected but i couldnt find the data....
    Transformation mapping also i did...
    i think may be some error in reading the data from the xml file but not so sure.....
    please reply to this mail as soon as possible its very urgent

    Michael R wrote:
    The target table will be created when you execute the interface, if you set the option on the flow tab as instructed in step #6 of the "Setting up ODI Constraint on CLIENT Datastore" Section.
    Option     Value
    CREATE_TARG_TABLE      trueHi Michel,
    This was not my required answer.I am sorry that I was unable to clarify my question.Actually
    +This project executed successfully with some warning.Target Table is automatically created in database and also populated with data.But when I right-click Target Datastore(in >Mapping Tab of the Interface), and then select Data to View Data that needs to be inserted in the target table.I get some error like this:-...+This above line is the result of my project my problem is
    when I right-click Target Datastore(in Mapping Tab of the Interface), and then select Data to View Data that already inserted in the target table.Is not shown by the view data operation.
    I meant to say I am facing this error
    At the10(1010 written) step of
    Creating a New ODI Interface to Perform XML File to RDBMS Table Transformation
    wehre it says
    Open the Interface tab. Select Mapping tab, right-click Target Datastore - CLIENT, and then select Data. View Data inserted in the target table. Close Data Editor. Close the tabs...
    In my case when I use my sqldeveloper I can see data successfully inserted in my target table and also in error table (data that can't satisfy the constraint) .But I was unable to check this by following the above mentioned 10 th step and got this error.
    Thanks

  • Setting valueAxis for makit chart in XML view

    Dear Experts,
    I am trying to set a valueAxis limit on value 0,5.
    My XML looks like this. I couldnt add valueAxis in ma:Chart successfully.
    <ma:Chart id="idChart" height="100%" width="100%" type="Line"
      rows="{/entries}" showRangeSelector="true" showTableView="false"
      showTotalValue="false">
      <ma:category>
      <ma:Category column="date" displayName="Date" />
      </ma:category>
      <ma:values>
      <ma:Value expression="value" displayName="Value" type="number"/>
      </ma:values>
      <ma:rows>
      <ma:Row>
      <ma:cells>
      <ma:Column name="date" value="{date}" />
      <ma:Column name="value" value="{value}"
      type="number" />
      </ma:cells>
      </ma:Row>
      </ma:rows>
      <ma:columns>
      <ma:Column name="date" value="{date}" />
      <ma:Column name="value" value="{value}" type="number"  />
      </ma:columns>
      </ma:Chart>
    The error was: Uncaught Error: valueAxis property must be of type sap.makit.ValueAxis
    Basically I cant create a new instance of ValueAxis in XML.
    I tried in the controller js something like this:
    var oChart = this.getView().byId("idChart");
    oChart.valueAxis =  new sap.makit.ValueAxis({min : "0.5"});
    This also didnt work.
    So I  have two questions:
    1.) How can I set valueAxis in XML view staticly?
    2.) How can I set valueAxis in controller dynamicly according to the values I get from my json service.
    Thanks for any help!
    Regards,
    Koray

    Try doing,
    oChart.setValueAxis(new sap.makit.ValueAxis({min : "0.5"}));

  • Populating values on a table view

    Hi,
    Following is the xml webservice response:
    <?xml version='1.0' encoding='utf-8'?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <ns:getAvailableResourcesResponse xmlns:ns="http://webservices.iphoneapps.com" xmlns:ax21="http://vo.iphoneapps.com/xsd">
    <ns:return>JOHN</ns:return>
    <ns:return>KATE</ns:return>
    <ns:return>JOLIE</ns:return>
    <ns:return>DOLSON</ns:return>
    </ns:getAvailableResourcesResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    From the above xml I am trying to parse <ns:return>tags i am getting the output values as "JOHNKATEJOLIEDOLSON" but the I am unable to seperate those values and populate those values in the table view, one after the other.
    Following is the code that i used for parsing:
    -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *)qName
    attributes: (NSDictionary *)attributeDict
    if([ elementName isEqualToString:@"ns:return" ])
    NSLog(@"ns:return");
    if (!soapResults)
    soapResults=[[NSMutableString alloc]init];
    NSLog(@"%d", soapResults);
    elementFound=YES;
    -(void)parser:(NSXMLParser *) parser foundCharacters:(NSString *)string
    if (elementFound)
    //[arrayResources addObject:string];
    [soapResults appendString: string];
    NSLog(@"%@", soapResults);
    [self release];
    -(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
    if( [ elementName isEqualToString:@"ns:return" ])
    elementFound=FALSE;
    Can anyone please suggest me how to parse the xml statement and populate the values in the table view with sample example.
    Regards
    SRI.
    Message was edited by: ksri

    Only you can solve the issue by learning about namespaces. You are comparing element names against fully-qualified names. Then you are logging what you think you have received. Change your NSLog statements to log what is really being parsed instead of a literal. That should prove enlightening.

  • JTree XML Viewer

    Hi all
    i found this great article http://www.javalobby.org/java/forums/m91839339.html on Xml Viewer.
    But i dont understand how i can use it for JTreeTable because JTreeTable needs a TreeTableModel but
    i have a XMLTableModel .
    Anyone has used it?
    Thanks!!

    Hi all i try to modify the example that i find to make the tree editable but it not works...
    The main
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.event.InputEvent;
    import java.awt.event.MouseEvent;
    import java.util.EventObject;
    import javax.swing.JScrollPane;
    public class MyTreeTable extends JTreeTable{
        public MyTreeTable(TreeTableModel treeTableModel){
            super(treeTableModel);
            setShowGrid(true);
            setGridColor(new Color(234, 234, 234));
            new TableColumnResizer(this);
           // setDefaultRenderer(XMLTreeTableModel.class, new  XMLTreeTableCellRenderer());
            setIntercellSpacing(new Dimension(1, 1));
        public boolean editCellAt(int row, int column, EventObject e){
            if(e instanceof MouseEvent){
                MouseEvent me = (MouseEvent)e;
                // If the modifiers are not 0 (or the left mouse button),
                // tree may try and toggle the selection, and table
                // will then try and toggle, resulting in the
                // selection remaining the same. To avoid this, we
                // only dispatch when the modifiers are 0 (or the left mouse
                // button).
                if(me.getModifiers()==0 ||
                        me.getModifiers()==InputEvent.BUTTON1_MASK){
                    for(int counter = getColumnCount()-1; counter>= 0;
                        counter--){
                        if(getColumnClass(counter)==TreeTableModel.class){
                            MouseEvent newME = new MouseEvent
                                    (tree, me.getID(),
                                            me.getWhen(), me.getModifiers(),
                                            me.getX()-getCellRect(0, counter, true).x,
                                            me.getY(), me.getClickCount(),
                                            me.isPopupTrigger());
                            tree.dispatchEvent(newME);
                            break;
                return false;
            return super.editCellAt(row, column, e);
        public void changeSelection(int row, int column, boolean toggle, boolean extend) {
            if(getCursor()==TableColumnResizer.resizeCursor)
                return;
            super.changeSelection(row, column, toggle, extend);
    }The editor
    import java.util.EventObject;
    import javax.swing.CellEditor;
    import javax.swing.event.CellEditorListener;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.EventListenerList;
    public class AbstractCellEditor implements CellEditor {
        protected EventListenerList listenerList = new EventListenerList();
        public Object getCellEditorValue() { return null; }
        public boolean isCellEditable(EventObject e) { return true; }
        public boolean shouldSelectCell(EventObject anEvent) { return false; }
        public boolean stopCellEditing() { return true; }
        public void cancelCellEditing() {}
        public void addCellEditorListener(CellEditorListener l) {
         listenerList.add(CellEditorListener.class, l);
        public void removeCellEditorListener(CellEditorListener l) {
         listenerList.remove(CellEditorListener.class, l);
         * Notify all listeners that have registered interest for
         * notification on this event type. 
         * @see EventListenerList
        protected void fireEditingStopped() {
         // Guaranteed to return a non-null array
         Object[] listeners = listenerList.getListenerList();
         // Process the listeners last to first, notifying
         // those that are interested in this event
         for (int i = listeners.length-2; i>=0; i-=2) {
             if (listeners==CellEditorListener.class) {
              ((CellEditorListener)listeners[i+1]).editingStopped(new ChangeEvent(this));
    * Notify all listeners that have registered interest for
    * notification on this event type.
    * @see EventListenerList
    protected void fireEditingCanceled() {
         // Guaranteed to return a non-null array
         Object[] listeners = listenerList.getListenerList();
         // Process the listeners last to first, notifying
         // those that are interested in this event
         for (int i = listeners.length-2; i>=0; i-=2) {
         if (listeners[i]==CellEditorListener.class) {
              ((CellEditorListener)listeners[i+1]).editingCanceled(new ChangeEvent(this));
    XML Parserimport javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.sax.SAXSource;
    import org.w3c.dom.Document;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    public class DOMUtil{
    public static Document createDocument(InputSource is) throws Exception{
    SAXParserFactory saxFactory = SAXParserFactory.newInstance();
    SAXParser parser = saxFactory.newSAXParser();
    XMLReader reader = new XMLTrimFilter(parser.getXMLReader());
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "no");
    DOMResult result = new DOMResult();
    transformer.transform(new SAXSource(reader, is), result);
    return (Document)result.getNode();
    } The treeimport java.awt.Color;
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Rectangle;
    import java.awt.event.InputEvent;
    import java.awt.event.MouseEvent;
    import java.util.EventObject;
    import javax.swing.DefaultCellEditor;
    import javax.swing.Icon;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.JTree;
    import javax.swing.ListSelectionModel;
    import javax.swing.LookAndFeel;
    import javax.swing.UIManager;
    import javax.swing.border.Border;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeSelectionModel;
    import javax.swing.tree.TreeCellRenderer;
    import javax.swing.tree.TreeModel;
    import javax.swing.tree.TreePath;
    public class JTreeTable extends JTable {
         /** A subclass of JTree. */
         protected TreeTableCellRenderer tree;
         public JTreeTable(TreeTableModel treeTableModel) {
              super();
              // Creates the tree. It will be used as a renderer and editor.
              tree = new TreeTableCellRenderer(treeTableModel);
              // Installs a tableModel representing the visible rows in the tree.
              super.setModel(new TreeTableModelAdapter(treeTableModel, tree));
              tree.setCellRenderer(new XMLTreeTableCellRenderer());
              // Forces the JTable and JTree to share their row selection models.
              ListToTreeSelectionModelWrapper selectionWrapper = new ListToTreeSelectionModelWrapper();
              tree.setSelectionModel(selectionWrapper);
              setSelectionModel(selectionWrapper.getListSelectionModel());
              // Installs the tree editor renderer and editor.
              setDefaultRenderer(TreeTableModel.class, tree);
              setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
              // No grid.
              setShowGrid(false);
              // No intercell spacing
              setIntercellSpacing(new Dimension(0, 0));
              // And update the height of the trees row to match that of
              // the table.
              if (tree.getRowHeight() < 1) {
                   // Metal looks better like this.
                   setRowHeight(20);
         * Overridden to message super and forward the method to the tree. Since the
         * tree is not actually in the component hierarchy it will never receive
         * this unless we forward it in this manner.
         public void updateUI() {
              super.updateUI();
              if (tree != null) {
                   tree.updateUI();
                   // Do this so that the editor is referencing the current renderer
                   // from the tree. The renderer can potentially change each time
                   // laf changes.
                   setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
              // Use the tree's default foreground and background colors in the
              // table.
              LookAndFeel.installColorsAndFont(this, "Tree.background",
                        "Tree.foreground", "Tree.font");
         * Workaround for BasicTableUI anomaly. Make sure the UI never tries to
         * resize the editor. The UI currently uses different techniques to paint
         * the renderers and editors; overriding setBounds() below is not the right
         * thing to do for an editor. Returning -1 for the editing row in this case,
         * ensures the editor is never painted.
         public int getEditingRow() {
              return (getColumnClass(editingColumn) == TreeTableModel.class) ? -1
                        : editingRow;
         * Returns the actual row that is editing as <code>getEditingRow</code>
         * will always return -1.
         private int realEditingRow() {
              return editingRow;
         * This is overridden to invoke super's implementation, and then, if the
         * receiver is editing a Tree column, the editor's bounds is reset. The
         * reason we have to do this is because JTable doesn't think the table is
         * being edited, as <code>getEditingRow</code> returns -1, and therefore
         * doesn't automatically resize the editor for us.
         public void sizeColumnsToFit(int resizingColumn) {
              super.sizeColumnsToFit(resizingColumn);
              if (getEditingColumn() != -1
                        && getColumnClass(editingColumn) == TreeTableModel.class) {
                   Rectangle cellRect = getCellRect(realEditingRow(),
                             getEditingColumn(), false);
                   Component component = getEditorComponent();
                   component.setBounds(cellRect);
                   component.validate();
         * Overridden to pass the new rowHeight to the tree.
         public void setRowHeight(int rowHeight) {
              super.setRowHeight(rowHeight);
              if (tree != null && tree.getRowHeight() != rowHeight) {
                   tree.setRowHeight(getRowHeight());
         * Returns the tree that is being shared between the model.
         public JTree getTree() {
              return tree;
         * Overridden to invoke repaint for the particular location if the column
         * contains the tree. This is done as the tree editor does not fill the
         * bounds of the cell, we need the renderer to paint the tree in the
         * background, and then draw the editor over it.
         public boolean editCellAt(int row, int column, EventObject e) {
              boolean retValue = super.editCellAt(row, column, e);
              if (retValue && getColumnClass(column) == TreeTableModel.class) {
                   repaint(getCellRect(row, column, false));
              return retValue;
         * A TreeCellRenderer that displays a JTree.
         public class TreeTableCellRenderer extends JTree implements
                   TableCellRenderer {
              /** Last table/tree row asked to renderer. */
              protected int visibleRow;
              * Border to draw around the tree, if this is non-null, it will be
              * painted.
              protected Border highlightBorder;
              public TreeTableCellRenderer(TreeModel model) {
                   super(model);
              * updateUI is overridden to set the colors of the Tree's renderer to
              * match that of the table.
              public void updateUI() {
                   super.updateUI();
                   // Make the tree's cell renderer use the table's cell selection
                   // colors.
                   TreeCellRenderer tcr = getCellRenderer();
                   if (tcr instanceof DefaultTreeCellRenderer) {
                        DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr);
                        // For 1.1 uncomment this, 1.2 has a bug that will cause an
                        // exception to be thrown if the border selection color is
                        // null.
                        // dtcr.setBorderSelectionColor(null);
                        dtcr.setTextSelectionColor(UIManager
                                  .getColor("Table.selectionForeground"));
                        dtcr.setBackgroundSelectionColor(UIManager
                                  .getColor("Table.selectionBackground"));
              * Sets the row height of the tree, and forwards the row height to the
              * table.
              public void setRowHeight(int rowHeight) {
                   if (rowHeight > 0) {
                        super.setRowHeight(rowHeight);
                        if (JTreeTable.this != null
                                  && JTreeTable.this.getRowHeight() != rowHeight) {
                             JTreeTable.this.setRowHeight(getRowHeight());
              * This is overridden to set the height to match that of the JTable.
              public void setBounds(int x, int y, int w, int h) {
                   super.setBounds(x, 0, w, JTreeTable.this.getHeight());
              * Sublcassed to translate the graphics such that the last visible row
              * will be drawn at 0,0.
              public void paint(Graphics g) {
                   g.translate(0, -visibleRow * getRowHeight());
                   super.paint(g);
                   // Draw the Table border if we have focus.
                   if (highlightBorder != null) {
                        highlightBorder.paintBorder(this, g, 0, visibleRow
                                  * getRowHeight(), getWidth(), getRowHeight());
              * TreeCellRenderer method. Overridden to update the visible row.
              public Component getTableCellRendererComponent(JTable table,
                        Object value, boolean isSelected, boolean hasFocus, int row,
                        int column) {
                   Color background;
                   Color foreground;
                   if (isSelected) {
                        background = table.getSelectionBackground();
                        foreground = table.getSelectionForeground();
                   } else {
                        background = table.getBackground();
                        foreground = table.getForeground();
                   highlightBorder = null;
                   if (realEditingRow() == row && getEditingColumn() == column) {
                        background = UIManager.getColor("Table.focusCellBackground");
                        foreground = UIManager.getColor("Table.focusCellForeground");
                   } else if (hasFocus) {
                        highlightBorder = UIManager
                                  .getBorder("Table.focusCellHighlightBorder");
                        if (isCellEditable(row, column)) {
                             background = UIManager
                                       .getColor("Table.focusCellBackground");
                             foreground = UIManager
                                       .getColor("Table.focusCellForeground");
                   visibleRow = row;
                   setBackground(background);
                   TreeCellRenderer tcr = getCellRenderer();
                   if (tcr instanceof DefaultTreeCellRenderer) {
                        DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer) tcr);
                        if (isSelected) {
                             dtcr.setTextSelectionColor(foreground);
                             dtcr.setBackgroundSelectionColor(background);
                        } else {
                             dtcr.setTextNonSelectionColor(foreground);
                             dtcr.setBackgroundNonSelectionColor(background);
                   return this;
         * An editor that can be used to edit the tree column. This extends
         * DefaultCellEditor and uses a JTextField (actually, TreeTableTextField) to
         * perform the actual editing.
         * <p>
         * To support editing of the tree column we can not make the tree editable.
         * The reason this doesn't work is that you can not use the same component
         * for editing and renderering. The table may have the need to paint cells,
         * while a cell is being edited. If the same component were used for the
         * rendering and editing the component would be moved around, and the
         * contents would change. When editing, this is undesirable, the contents of
         * the text field must stay the same, including the caret blinking, and
         * selections persisting. For this reason the editing is done via a
         * TableCellEditor.
         * <p>
         * Another interesting thing to be aware of is how tree positions its render
         * and editor. The render/editor is responsible for drawing the icon
         * indicating the type of node (leaf, branch...). The tree is responsible
         * for drawing any other indicators, perhaps an additional +/- sign, or
         * lines connecting the various nodes. So, the renderer is positioned based
         * on depth. On the other hand, table always makes its editor fill the
         * contents of the cell. To get the allusion that the table cell editor is
         * part of the tree, we don't want the table cell editor to fill the cell
         * bounds. We want it to be placed in the same manner as tree places it
         * editor, and have table message the tree to paint any decorations the tree
         * wants. Then, we would only have to worry about the editing part. The
         * approach taken here is to determine where tree would place the editor,
         * and to override the <code>reshape</code> method in the JTextField
         * component to nudge the textfield to the location tree would place it.
         * Since JTreeTable will paint the tree behind the editor everything should
         * just work. So, that is what we are doing here. Determining of the icon
         * position will only work if the TreeCellRenderer is an instance of
         * DefaultTreeCellRenderer. If you need custom TreeCellRenderers, that don't
         * descend from DefaultTreeCellRenderer, and you want to support editing in
         * JTreeTable, you will have to do something similiar.
         public class TreeTableCellEditor extends DefaultCellEditor {
              public TreeTableCellEditor() {
                   super(new TreeTableTextField());
              * Overridden to determine an offset that tree would place the editor
              * at. The offset is determined from the <code>getRowBounds</code>
              * JTree method, and additionally from the icon DefaultTreeCellRenderer
              * will use.
              * <p>
              * The offset is then set on the TreeTableTextField component created in
              * the constructor, and returned.
              public Component getTableCellEditorComponent(JTable table,
                        Object value, boolean isSelected, int r, int c) {
                   Component component = super.getTableCellEditorComponent(table,
                             value, isSelected, r, c);
                   JTree t = getTree();
                   boolean rv = t.isRootVisible();
                   int offsetRow = rv ? r : r - 1;
                   Rectangle bounds = t.getRowBounds(offsetRow);
                   int offset = bounds.x;
                   TreeCellRenderer tcr = t.getCellRenderer();
                   if (tcr instanceof DefaultTreeCellRenderer) {
                        Object node = t.getPathForRow(offsetRow).getLastPathComponent();
                        Icon icon;
                        if (t.getModel().isLeaf(node))
                             icon = ((DefaultTreeCellRenderer) tcr).getLeafIcon();
                        else if (tree.isExpanded(offsetRow))
                             icon = ((DefaultTreeCellRenderer) tcr).getOpenIcon();
                        else
                             icon = ((DefaultTreeCellRenderer) tcr).getClosedIcon();
                        if (icon != null) {
                             offset += ((DefaultTreeCellRenderer) tcr).getIconTextGap()
                                       + icon.getIconWidth();
                   ((TreeTableTextField) getComponent()).offset = offset;
                   return component;
              * This is overridden to forward the event to the tree. This will return
              * true if the click count >= 3, or the event is null.
              public boolean isCellEditable(EventObject e) {
                   if (e instanceof MouseEvent) {
                        MouseEvent me = (MouseEvent) e;
                        // If the modifiers are not 0 (or the left mouse button),
                        // tree may try and toggle the selection, and table
                        // will then try and toggle, resulting in the
                        // selection remaining the same. To avoid this, we
                        // only dispatch when the modifiers are 0 (or the left mouse
                        // button).
                        if (me.getModifiers() == 0
                                  || me.getModifiers() == InputEvent.BUTTON1_MASK) {
                             for (int counter = getColumnCount() - 1; counter >= 0; counter--) {
                                  if (getColumnClass(counter) == TreeTableModel.class) {
                                       MouseEvent newME = new MouseEvent(
                                                 JTreeTable.this.tree, me.getID(), me
                                                           .getWhen(), me.getModifiers(), me
                                                           .getX()
                                                           - getCellRect(0, counter, true).x,
                                                 me.getY(), me.getClickCount(), me
                                                           .isPopupTrigger());
                                       JTreeTable.this.tree.dispatchEvent(newME);
                                       break;
                        if (me.getClickCount() >= 3) {
                             return true;
                        return false;
                   if (e == null) {
                        return true;
                   return false;
         * Component used by TreeTableCellEditor. The only thing this does is to
         * override the <code>reshape</code> method, and to ALWAYS make the x
         * location be <code>offset</code>.
         static class TreeTableTextField extends JTextField {
              public int offset;
              public void reshape(int x, int y, int w, int h) {
                   int newX = Math.max(x, offset);
                   super.reshape(newX, y, w - (newX - x), h);
         * ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel to
         * listen for changes in the ListSelectionModel it maintains. Once a change
         * in the ListSelectionModel happens, the paths are updated in the
         * DefaultTreeSelectionModel.
         class ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel {
              /** Set to true when we are updating the ListSelectionModel. */
              protected boolean updatingListSelectionModel;
              public ListToTreeSelectionModelWrapper() {
                   super();
                   getListSelectionModel().addListSelectionListener(
                             createListSelectionListener());
              * Returns the list selection model. ListToTreeSelectionModelWrapper
              * listens for changes to this model and updates the selected paths
              * accordingly.
              ListSelectionModel getListSelectionModel() {
                   return listSelectionModel;
              * This is overridden to set <code>updatingListSelectionModel</code>
              * and message super. This is the only place DefaultTreeSelectionModel
              * alters the ListSelectionModel.
              public void resetRowSelection() {
                   if (!updatingListSelectionModel) {
                        updatingListSelectionModel = true;
                        try {
                             super.resetRowSelection();
                        } finally {
                             updatingListSelectionModel = false;
                   // Notice how we don't message super if
                   // updatingListSelectionModel is true. If
                   // updatingListSelectionModel is true, it implies the
                   // ListSelectionModel has already been updated and the
                   // paths are the only thing that needs to be updated.
              * Creates and returns an instance of ListSelectionHandler.
              protected ListSelectionListener createListSelectionListener() {
                   return new ListSelectionHandler();
              * If <code>updatingListSelectionModel</code> is false, this will
              * reset the selected paths from the selected rows in the list selection
              * model.
              protected void updateSelectedPathsFromSelectedRows() {
                   if (!updatingListSelectionModel) {
                        updatingListSelectionModel = true;
                        try {
                             // This is way expensive, ListSelectionModel needs an
                             // enumerator for iterating.
                             int min = listSelectionModel.getMinSelectionIndex();
                             int max = listSelectionModel.getMaxSelectionIndex();
                             clearSelection();
                             if (min != -1 && max != -1) {
                                  for (int counter = min; counter <= max; counter++) {
                                       if (listSelectionModel.isSelectedIndex(counter)) {
                                            TreePath selPath = tree.getPathForRow(counter);
                                            if (selPath != null) {
                                                 addSelectionPath(selPath);
                        } finally {
                             updatingListSelectionModel = false;
              * Class responsible for calling updateSelectedPathsFromSelectedRows
              * when the selection of the list changse.
              class ListSelectionHandler implements ListSelectionListener {
                   public void valueChanged(ListSelectionEvent e) {
                        updateSelectedPathsFromSelectedRows();
    The resizerimport java.awt.Container;
    import java.awt.Cursor;
    import java.awt.Dimension;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.MouseEvent;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JViewport;
    import javax.swing.event.MouseInputAdapter;
    import javax.swing.table.TableColumn;
    public class TableColumnResizer extends MouseInputAdapter{
    public static Cursor resizeCursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
    private int mouseXOffset;
    private Cursor otherCursor = resizeCursor;
    private JTable table;
    public TableColumnResizer(JTable table){
    this.table = table;
    table.addMouseListener(this);
    table.addMouseMotionListener(this);
    private boolean canResize(TableColumn column){
    return column != null
    && table.getTableHeader().getResizingAllowed()
    && column.getResizable();
    private TableColumn getResizingColumn(Point p){
    return getResizingColumn(p, table.columnAtPoint(p));
    private TableColumn getResizingColumn(Point p, int column){
    if(column == -1){
    return null;
    int row = table.rowAtPoint(p);
    if(row==-1)
    return null;
    Rectangle r = table.getCellRect(row, column, true);
    r.grow( -3, 0);
    if(r.contains(p))
    return null;
    int midPoint = r.x + r.width / 2;
    int columnIndex;
    if(table.getTableHeader().getComponentOrientation().isLeftToRight())
    columnIndex = (p.x < midPoint) ? column - 1 : column;
    else
    columnIndex = (p.x < midPoint) ? column : column - 1;
    if(columnIndex == -1)
    return null;
    return table.getTableHeader().getColumnModel().getColumn(columnIndex);
    public void mousePressed(MouseEvent e){
    table.getTableHeader().setDraggedColumn(null);
    table.getTableHeader().setResizingColumn(null);
    table.getTableHeader().setDraggedDistance(0);
    Point p = e.getPoint();
    // First find which header cell was hit
    int index = table.columnAtPoint(p);
    if(index==-1)
    return;
    // The last 3 pixels + 3 pixels of next column are for resizing
    TableColumn resizingColumn = getResizingColumn(p, index);
    if(!canResize(resizingColumn))
    return;
    table.getTableHeader().setResizingColumn(resizingColumn);
    if(table.getTableHeader().getComponentOrientation().isLeftToRight())
    mouseXOffset = p.x - resizingColumn.getWidth();
    else
    mouseXOffset = p.x + resizingColumn.getWidth();
    private void swapCursor(){
    Cursor tmp = table.getCursor();
    table.setCursor(otherCursor);
    otherCursor = tmp;
    public void mouseMoved(MouseEvent e){
    if(canResize(getResizingColumn(e.getPoint()))
    != (table.getCursor() == resizeCursor)){
    swapCursor();
    public void mouseDragged(MouseEvent e){
    int mouseX = e.getX();
    TableColumn resizingColumn = table.getTableHeader().getResizingColumn();
    boolean headerLeftToRight =
    table.getTableHeader().getComponentOrientation().isLeftToRight();
    if(resizingColumn != null){
    int oldWidth = resizingColumn.getWidth();
    int newWidth;
    if(headerLeftToRight){
    newWidth = mouseX - mouseXOffset;
    } else{
    newWidth = mouseXOffset - mouseX;
    resizingColumn.setWidth(newWidth);
    Container container;
    if((table.getTableHeader().getParent() == null)
    || ((container = table.getTableHeader().getParent().getParent()) == null)
    || !(container instanceof JScrollPane)){
    return;
    if(!container.getComponentOrientation().isLeftToRight()
    && !headerLeftToRight){
    if(table != null){
    JViewport viewport = ((JScrollPane)container).getViewport();
    int viewportWidth = viewport.getWidth();
    int diff = newWidth - oldWidth;
    int newHeaderWidth = table.getWidth() + diff;
    /* Resize a table */
    Dimension tableSize = table.getSize();
    tableSize.width += diff;
    table.setSize(tableSize);
    * If this table is in AUTO_RESIZE_OFF mode and has a horizontal
    * scrollbar, we need to update a view's position.
    if((newHeaderWidth >= viewportWidth)
    && (table.getAutoResizeMode() == JTable.AUTO_RESIZE_OFF)){
    Point p = viewport.getViewPosition();
    p.x =
    Math.max(0, Math.min(newHeaderWidth - viewportWidth, p.x + diff));
    viewport.setViewPosition(p);
    /* Update the original X offset value. */
    mouseXOffset += diff;
    public void mouseReleased(MouseEvent e){
    table.getTableHeader().setResizingColumn(null);
    table.getTableHeader().setDraggedColumn(null);
    The mainimport java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import org.xml.sax.InputSource;
    public class TreeTableExample0 {
         public static void main(String[] args) throws Exception {
              new TreeTableExample0();
         public TreeTableExample0() throws Exception {
              JFrame frame = new JFrame("TreeTable");
              InputStream inputStream = new FileInputStream("c:\\totali.xml");
              InputSource inputSource = new InputSource(inputStream);
              MyTreeTable treeTable = new MyTreeTable(new XMLTreeTableModel(DOMUtil
                        .createDocument(inputSource)));
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent we) {
                        System.exit(0);
              frame.getContentPane().add(new JScrollPane(treeTable));
              frame.pack();
              frame.show();
    The modelimport javax.swing.tree.TreeModel;
    public interface TreeTableModel extends TreeModel
    * Returns the number of available columns.
    public int getColumnCount();
    * Returns the name for column number <code>column</code>.
    public String getColumnName(int column);
    * Returns the type for column number <code>column</code>.
    public Class getColumnClass(int column);
    * Returns the value to be displayed for node <code>node</code>,
    * at column number <code>column</code>.
    public Object getValueAt(Object node

  • Assigning a node value from an XML variable to a String type  in Weblogic Process Integrator

    Hi,
    Is there any way to assign a node value from an XML variable to a String variable
    in Weblogic Process Integrator...
    Thanx.
    Narendra.

    Nerendra
    Are you talking about using Xpath on the XML document and assigning to a
    variable, it is unclear what you are asking
    Tony
    "Narendra" <[email protected]> wrote in message
    news:3bba1215$[email protected]..
    >
    Hi,
    Is there any way to assign a node value from an XML variable to a Stringvariable
    in Weblogic Process Integrator...
    Thanx.
    Narendra.

  • BI Publisher Report Build - XML view

    Hi Experts,
    I am trying to build the BI publisher report. During the process, I am defining the SQL query structure in the 'Query Builder' once after that I have saved the report.
    As part of the next step , I have clicked on 'view' link to view the report structure as mentioned in the OBE.
    I could only see the 'Data' view but not the 'XML' view. Is there any way I can see the 'XML' view.
    Any help would be appreciated
    Siva

    Data means look at the xml data that you have created.

  • How to retrieve value from AIAInstallProperties.xml in AIA Flow.

    After PIP Developement, Installer team will build the OUI installer for the PIP.They will build the screens for our PIP based on the requirements we give them.We give them a list of properties that we need the installer to prompt for and then the installer will store the values entered by the user in AIAInstallProperties.xml file.When the code is written, these properties are used instead of hardcoding any machine names, usernames, passwords, etc. When the services are deployed the properties are replaced with the values in AIAInstallProperties.xml.
    How to retreive those values from AIAInstallProperties.xml file to your participating applications or any adapters in your code?
    When the services are deployed how the properties are getting replaced with the values in AIAInstallProperties.xml.?
    Can anyone explain the above two flow.
    Thanks in advance.

    Hi
    Prem Edwin's posting about AIAInstallProperties.xml is correct.
    Two points, the 11gR1 is a foundation pack only release, that is why the OUI is only built to collect FP related information. In the future, when PIPs arrive, new wizard steps will involve to collect PIP specific information during installation/deployment time.
    For your example of of getting a file location during installation, it would be effectively for your self-built PIPs. That is why the 11gR1 FP OUI would not support that.
    Also, there are only finite number of tokens can be detokenized from AIAInstallProperties.xml to composite.xml, if you were introducing a random new 'file path', I don't believe it would be replaced automatically by default in R1 time.
    Thanks!

  • Display of missing values in a table view.

    Hi everyone,
    I have a table view with 7 columns and 10 rows which displays only those values which are missing in the DataBase Table.
    Is it possible to show only the missing values as '-' in a table view, the table view is having 7 different fields.
    Also when the value is inserted at run time the corresponding field should be updated accordingly and the value will no longer be displayed in the table view as '-'
    please advice.
    Regards
    Neo.

    Welcome to SDN.
    do you mean to say that in some rows some column values will be blank and you want to replace the blanks with '-'.
    loop thru the itab which you are passing to tableview and for the blank cells pass '-'.
    <i>Also when the value is inserted at run time</i>
    so you are having editable tableview. to update the value back to the dbtable, you have to read it in oninputprocessing and update it to dbtable .
    search the forum on how to read the user entered value from the table view so that you can update the dbtable.
    Regards
    Raja

  • List view error "Filter Value is not in a supported date format"

    I've column "Name = Order Status","Type = Calculated" & Data Type = "Date and Time". I've given this Condition in the formula:- =IF(NOT([PO Date]=0),"ORDERED","NOT ORDERED"). I'm trying to create view
    for this column but its getting error while create the view "Filter Value is not in a supported date format". 
    Same error I'm getting for column "Name = Status","Type = Calculated" & Data Type = "Number". I've given this Condition in the formula:- =IF([PO Date]="","",IF(NOT([Balance Qty]=0),"OPEN","CLOSED"))

    Can you check data type returned for your calculated column 'Balance Qty'?
    Try to set it as Number. It may help you.
    Thanks.

  • Binding Data from OfflineStore to List in XML view

    Hi Experts,
    I am developing an application using SAP WebIDE. While loading a page, I want to read some data from an offlineStore and show it in a listview.
    Following is my code for xml view:
    <sap.ui.core.mvc:View xmlns="sap.m" xmlns:sap.ui.core="sap.ui.core" xmlns:sap.ui.core.mvc="sap.ui.core.mvc" controllerName="com.arteria.view.CustomerList">
        <Page title="Customers" showNavButton="true">
       </Page>
    </sap.ui.core.mvc:View>
    And my js code is as follows:
    onInit: function() {
      this.getView().addEventDelegate({
       onBeforeShow: function(evt) {
        sap.ui.getCore().byId("idCustomerList").getController().read();
    read:function() {
                    oList = new sap.m.List();
                    oList.removeAllItems();
                    var uri = window.localStorage.getItem("ApplicationEndpointURL");
                    var user = window.localStorage.getItem("User");
                    var password = window.localStorage.getItem("Password");
                    var headers = { "X-SMP-APPCID" : window.localStorage.getItem("ApplicationConnectionId") };
                    // Create OData model from URL
                    var oModel = new sap.ui.model.odata.ODataModel(uri, true, user, password, headers);
                    var iOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false );
                    if (iOS) {
                        oModel = new sap.ui.model.odata.ODataModel(uri, true, user, password, headers);
                    var oTemplate = new sap.m.StandardListItem({
                                                               title: "{CustomerNumber}", description: "{CustomerName}", tap:"handleProductListItemPress", type:"Navigation"    
                    oList.setModel(oModel);
                    oList.bindItems("/Customers", oTemplate, null, null);
                    var custListPage = sap.ui.getCore().byId("idCustomerList");
                    custListPage.addCustomData(oList);
       handleProductListItemPress: function(oEvent) {
            sap.ui.getCore().getEventBus().publish("nav", "to", {
                id : "idCustomerDetail",
                context: oEvent.getSource().getBindingContext()
    The problem is I am getting a blank page. The list is not getting attached to the page.
    Waiting for your reply.
    Regards,
    Dhani

    why not move List definitiaon to XML 
    <sap.ui.core.mvc:View xmlns="sap.m" xmlns:sap.ui.core="sap.ui.core" xmlns:sap.ui.core.mvc="sap.ui.core.mvc" controllerName="com.arteria.view.CustomerList"> 
        <Page title="Customers" showNavButton="true"> 
    <List id="CustomerList"/>
       </Page> 
    </sap.ui.core.mvc:View> 
    so
    oList = this.byId("CustomerList");
    oList.setModel(oModel); 
                    oList.bindItems("/Customers", oTemplate, null, null); 
                    var custListPage = sap.ui.getCore().byId("idCustomerList"); 
                    custListPage.addCustomData(oList); 

  • Need help in extracting value from an xml tag.

    Hi ALL,
    Good Morning to all, i have problem in fetching a value from a xml tag. I have created a xml schema based on the schema i have created a xmltype table and inserted a value to the table. When i am trying to fetch a value from a particular tag i am unable to do so.. Kindly help me to solve this. Here by i am posting all the workings i have done...
    I am using the following client:
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 31 11:44:59 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    ////////////////////////////////// XML Schema ///////////////////////
    begin
    dbms_xmlschema.registerSchema(
    'http://www.oradev.com/chipsxml.xsd',
    '<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oradev.com/chipsxml.xsd"
    xmlns:samp="http://www.oradev.com/chipsxml.xsd"
    version="1.0">
    <element name="Field1">
    <complexType>
    <sequence>
         <element name="UTI">
              <complexType>
              <sequence>
              <element name = "U01" type = "string"/>
              <element name = "U02" type = "string"/>
              <element name = "U03" type = "string"/>
              <element name = "U03a" type = "string"/>
              <element name = "U03b" type = "string"/>          
              <element name = "U03c" type = "string"/>          
              <element name = "U04" type = "string"/>                    
              <element name = "U05" type = "string"/>                    
              </sequence>
              </complexType>
         </element>
    </sequence>
    </complexType>
    </element>
    </schema>',
    TRUE, TRUE, FALSE, FALSE);
    end;
    ////////////////////////// Table which has multiple Column //////////////////////////
    CREATE TABLE chipsxmltable1 (
    id number, XMLDATA XmlType)
    XMLTYPE XMLDATA STORE AS OBJECT RELATIONAL
    XMLSCHEMA "http://www.oradev.com/chipsxml.xsd"
    ELEMENT "Field1";
    ///////////////////////////////// Insert Query in chipsxmltable //////////////////////////
    INSERT INTO chipsxmltable VALUES(
    xmltype.createxml('<?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd" >
    <UTI>
    <U01>No</U01>
    <U02>Y</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>     
    <U04>Y</U04>
    <U05>Y</U05>          
    </UTI>
    </samp:Field1>'));
    To show the data as a field with structure:
    1. Query:
    Select * from chipsxmltable1;
    Output:
    ID XMLDATA
    1 <?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd">
    <UTI>
    <U01>No</U01>
    <U02>No</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>
    <U04>Y</U04>
    <U05>Y</U05>
    </UTI>
    </samp:Field1>
    2. Query: (Both the query displays the same Output)
         SELECT X.xmldata.getClobVal() "XMLDATA" FROM chipsxmltable1 X;
         select extract(XMLDATA, '/Field1').getstringval() "XMLDATA" from chipsxmltable1 x;
    Output:
    XMLDATA
    <?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd">
    <UTI>
    <U01>No</U01>
    <U02>No</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>
    <U04>Y</U04>
    <U05>Y</U05>
    </UTI>
    </samp:Field1>
    To show the data as a single string without structure using "getstringval()":
    3. Query
         select extract(XMLDATA, '//text()').getstringval() "CHIPS - XML" from chipsxmltable1 x;
    OUtput:
    CHIPS - XML
    NoNoYYYYYY
    To show the data as a single string without structure using "getclobval()":
    4.Query
         select extract(XMLDATA, '//text()').getClobVal() "CHIPS - XML" from chipsxmltable1 x;
    Output:
    CHIPS - XML
    NoNoYYYYYY
    To show the data in a particular tag with/Without structure (Which is not working) using "EXTRACT" function:
    6.Query:
         select extract(XMLDATA, '/Field1/text()').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI/U01').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI/U01/text()').getstringval() "XMLDATA" from chipsxmltable1 x;
    Output:
    CHIPS - XML
    The above queries are not fetching the value.
    To show the data in a particular tag with/Without structure (Which is not working) using "EXTRACTVALUE" function:
    7. Query:
         select extractValue(XMLDATA, '/Field1/UTI') "XMLDATA" from chipsxmltable1 x;
         select extractValue(XMLDATA, '/Field1/UTI/U01') "XMLDATA" from chipsxmltable1 x;
    Output:
    X
    The above queries are not fetching the value.
    My question is:
    How to fetch values from xml tag when the value are inserted through xml schema?
    Apologies if the description is not clear. Kindly let me know if further details are needed. Many thanks for your help.
    Very best regards,
    Godwin Jebakumar C.V.

    Hi,
    You need to declare the namespace of each element used in the XPath expression, like this :
    SQL> select extractvalue( XMLDATA
      2                     , '/samp:Field1/UTI/U01'
      3                     , 'xmlns:samp="http://www.oradev.com/chipsxml.xsd"' ) "XMLDATA"
      4  from chipsxmltable1 x
      5  ;
    XMLDATA
    No
    SQL> select extract( XMLDATA
      2                , '/samp:Field1/UTI'
      3                , 'xmlns:samp="http://www.oradev.com/chipsxml.xsd"'
      4                ).getstringval() "XMLDATA"
      5  from chipsxmltable1 x
      6  ;
    XMLDATA
    <UTI>
      <U01>No</U01>
      <U02>Y</U02>
      <U03>Y</U03>
      <U03a>Y</U03a>
      <U03b>Y</U03b>
      <U03c>Y</U03c>
      <U04>Y</U04>
      <U05>Y</U05>
    </UTI>
    Please see EXTRACT and EXTRACTVALUE documentation :
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions051.htm#i1006712
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions052.htm#SQLRF06173
    BTW, "XMLDATA" is a pseudo-column used by Oracle. I don't know if it'll ever cause any conflict but maybe you should rename your column.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/pseudocolumns010.htm#SQLRF00256
    Regards.

  • Reading UTF-8 Encoding xml file sqlserver

    Hi ,
    I am recieving a xml file from a third party vendor. it is encoded in UTF-8. while i am reading it i am getting the below error.
    Msg 9420, Level 16, State 1, Line 3
    XML parsing: line 30117390, character 33, illegal xml character
    the characters causing the problem are like è,Ö,è.
     My database default collation is ‘SQL_Latin1_General_CP1_CI_AS’
    I am using the below query to read the xmlfile.
    declare @xml xml
    SELECT
    @xml= CAST(x AS XML)
    FROM
    OPENROWSET(BULK 'D:\sample.xml',SINGLE_BLOB) AS T(x)
    select
    X.product.value('(ID/text())[1]', 'varchar(50)') as ID ,
    X.product.value('(Name/text())[1]', 'varchar(50)') as Name
    from
    @xml.nodes('Students/Student') AS X(product)
    how can i read the file successfully. any help is appreciated.
    Thanks in advance.

    This issue normally happens when the XML file is not in the correct format. To save in the correct format open the xml file and click save as. Choose the encoding option as "UTF-8".
    Regards, RSingh

  • How to read from a xml file(in String format) using a java program

    hi friends
    i have a string , which is xml format. i want read the values and display it.can any one suggest how to read a xml file of string format using a javaprogram
    thanks

            final DocumentBuilder db =  DocumentBuilderFactory.newInstance().newDocumentBuilder();      
            final InputStream documentStream = new ByteArrayInputStream(documentXMLSourceString.getBytes("utf-8"));
            final Document document = db.parse(documentStream);

Maybe you are looking for