Can we write query in xml file to get desired field?

I have  XML script like  below  can I query this file and get returns like Name only  for instance similar to 'select top 5 name from [HumanResources].[Department] order by DepartmentID'
Engineering
Tool Design
Sales
Marketing
Purchasing
<HumanResources.Department DepartmentID="1" Name="Engineering" GroupName="Research and Development" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="2" Name="Tool Design" GroupName="Research and Development" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="3" Name="Sales" GroupName="Sales and Marketing" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="4" Name="Marketing" GroupName="Sales and Marketing" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="5" Name="Purchasing" GroupName="Inventory Management" ModifiedDate="2002-06-01T00:00:00" />

DECLARE @xml xml='<HumanResources.Department DepartmentID="1" Name="Engineering" GroupName="Research and Development"
 ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="2" Name="Tool Design" 
GroupName="Research and Development" ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department 
DepartmentID="3" Name="Sales" GroupName="Sales and Marketing" ModifiedDate="2002-06-01T00:00:00" />
<HumanResources.Department DepartmentID="4" Name="Marketing" GroupName="Sales and Marketing" 
ModifiedDate="2002-06-01T00:00:00" /><HumanResources.Department DepartmentID="5" Name="Purchasing" 
GroupName="Inventory Management" ModifiedDate="2002-06-01T00:00:00" />'
SELECT T.Name.value('@Name', 'VARCHAR(50)') AS Name
FROM @xml.nodes('HumanResources.Department')
 AS T(Name);
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • How can i write also to xml file the settings of the Tag property to identify if it's "file" or "directory" ?

    The first thing i'm doing is to get from my ftp server all the ftp content information and i tag it so i can identify later if it's a file or a directory:
    private int total_dirs;
    private int searched_until_now_dirs;
    private int max_percentage;
    private TreeNode directories_real_time;
    private string SummaryText;
    private TreeNode CreateDirectoryNode(string path, string name , int recursive_levl )
    var directoryNode = new TreeNode(name);
    var directoryListing = GetDirectoryListing(path);
    var directories = directoryListing.Where(d => d.IsDirectory);
    var files = directoryListing.Where(d => !d.IsDirectory);
    total_dirs += directories.Count<FTPListDetail>();
    searched_until_now_dirs++;
    int percentage = 0;
    foreach (var dir in directories)
    directoryNode.Nodes.Add(CreateDirectoryNode(dir.FullPath, dir.Name, recursive_levl+1));
    if (recursive_levl == 1)
    TreeNode temp_tn = (TreeNode)directoryNode.Clone();
    this.BeginInvoke(new MethodInvoker( delegate
    UpdateList(temp_tn);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    foreach (var file in files)
    TreeNode file_tree_node = new TreeNode(file.Name);
    file_tree_node.Tag = "file";
    directoryNode.Nodes.Add(file_tree_node);
    numberOfFiles.Add(file.FullPath);
    return directoryNode;
    The line i'm using to Tag is:
    file_tree_node.Tag = "file";
    So i know what is "file" then i make a simple check if the Tag is not null then i know it's a "file" if it's null then it's directory.
    For example this is how i'm checking if it's file or directory after getting all the content from my ftp server:
    if (treeViewMS1.SelectedNode.Tag != null)
    string s = (string)treeViewMS1.SelectedNode.Tag;
    if (s == "file")
    file = false;
    DeleteFile(treeViewMS1.SelectedNode.FullPath, file);
    else
    RemoveDirectoriesRecursive(treeViewMS1.SelectedNode, treeViewMS1.SelectedNode.FullPath);
    I also update in real time when getting the content of the ftp server xml file on my hard disk with the treeView structure information so when i'm running the program each time it will load the treeView structure with all directories and files.
    This is the class of the xml file:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Xml;
    using System.Windows.Forms;
    namespace FTP_ProgressBar
    class TreeViewXmlPopulation
    // Xml tag for node, e.g. 'node' in case of <node></node>
    private const string XmlNodeTag = "node";
    // Xml attributes for node e.g. <node text="Asia" tag=""
    // imageindex="1"></node>
    private const string XmlNodeTextAtt = "text";
    private const string XmlNodeTagAtt = "tag";
    private const string XmlNodeImageIndexAtt = "imageindex";
    public static void DeserializeTreeView(TreeView treeView, string fileName)
    XmlTextReader reader = null;
    try
    // disabling re-drawing of treeview till all nodes are added
    treeView.BeginUpdate();
    reader = new XmlTextReader(fileName);
    TreeNode parentNode = null;
    while (reader.Read())
    if (reader.NodeType == XmlNodeType.Element)
    if (reader.Name == XmlNodeTag)
    TreeNode newNode = new TreeNode();
    bool isEmptyElement = reader.IsEmptyElement;
    // loading node attributes
    int attributeCount = reader.AttributeCount;
    if (attributeCount > 0)
    for (int i = 0; i < attributeCount; i++)
    reader.MoveToAttribute(i);
    SetAttributeValue(newNode,
    reader.Name, reader.Value);
    // add new node to Parent Node or TreeView
    if (parentNode != null)
    parentNode.Nodes.Add(newNode);
    else
    treeView.Nodes.Add(newNode);
    // making current node 'ParentNode' if its not empty
    if (!isEmptyElement)
    parentNode = newNode;
    // moving up to in TreeView if end tag is encountered
    else if (reader.NodeType == XmlNodeType.EndElement)
    if (reader.Name == XmlNodeTag)
    parentNode = parentNode.Parent;
    else if (reader.NodeType == XmlNodeType.XmlDeclaration)
    //Ignore Xml Declaration
    else if (reader.NodeType == XmlNodeType.None)
    return;
    else if (reader.NodeType == XmlNodeType.Text)
    parentNode.Nodes.Add(reader.Value);
    finally
    // enabling redrawing of treeview after all nodes are added
    treeView.EndUpdate();
    reader.Close();
    /// <span class="code-SummaryComment"><summary>
    /// Used by Deserialize method for setting properties of
    /// TreeNode from xml node attributes
    /// <span class="code-SummaryComment"></summary>
    private static void SetAttributeValue(TreeNode node,
    string propertyName, string value)
    if (propertyName == XmlNodeTextAtt)
    node.Text = value;
    else if (propertyName == XmlNodeImageIndexAtt)
    node.ImageIndex = int.Parse(value);
    else if (propertyName == XmlNodeTagAtt)
    node.Tag = value;
    public static void SerializeTreeView(TreeView treeView, string fileName)
    XmlTextWriter textWriter = new XmlTextWriter(fileName,
    System.Text.Encoding.ASCII);
    // writing the xml declaration tag
    textWriter.WriteStartDocument();
    //textWriter.WriteRaw("\r\n");
    // writing the main tag that encloses all node tags
    textWriter.WriteStartElement("TreeView");
    // save the nodes, recursive method
    SaveNodes(treeView.Nodes, textWriter);
    textWriter.WriteEndElement();
    textWriter.Close();
    private static void SaveNodes(TreeNodeCollection nodesCollection,
    XmlTextWriter textWriter)
    for (int i = 0; i < nodesCollection.Count; i++)
    TreeNode node = nodesCollection[i];
    textWriter.WriteStartElement(XmlNodeTag);
    textWriter.WriteAttributeString(XmlNodeTextAtt,
    node.Text);
    textWriter.WriteAttributeString(
    XmlNodeImageIndexAtt, node.ImageIndex.ToString());
    if (node.Tag != null)
    textWriter.WriteAttributeString(XmlNodeTagAtt,
    node.Tag.ToString());
    // add other node properties to serialize here
    if (node.Nodes.Count > 0)
    SaveNodes(node.Nodes, textWriter);
    textWriter.WriteEndElement();
    And this is how i'm using the class this method i'm calling it inside the CreateDirectoryNode and i'm updating the treeView in real time when getting the ftp content from the server i build the treeView structure in real time.
    DateTime last_update;
    private void UpdateList(TreeNode tn_rt)
    TimeSpan ts = DateTime.Now - last_update;
    if (ts.TotalMilliseconds > 200)
    last_update = DateTime.Now;
    treeViewMS1.BeginUpdate();
    treeViewMS1.Nodes.Clear();
    treeViewMS1.Nodes.Add(tn_rt);
    TreeViewXmlPopulation.SerializeTreeView(treeViewMS1, @"c:\XmlFile\Original.xml");
    ExpandToLevel(treeViewMS1.Nodes, 1);
    treeViewMS1.EndUpdate();
    And when i'm running the program again in the constructor i'm doing:
    if (File.Exists(@"c:\XmlFile\Original.xml"))
    TreeViewXmlPopulation.DeserializeTreeView(treeViewMS1, @"c:\XmlFile\Original.xml");
    My question is how can i update the xml file in real time like i'm doing now but also with the Tag property so next time i will run the program and will not get the content from the ftp i will know in the treeView what is file and what is directory.
    The problem is that now if i will run the program the Tag property is null. I must get the ftp content from the server each time.
    But i want that withoutout getting the ftp content from server to Tag each file as file in the treeView structure.
    So what i need is somehow where i;m Tagging "file" or maybe when updating the treeView also to add something to the xml file so when i will run the progrma again and read back the xml file it will also Tag the files in the treeView.

    Hi
    Chocolade1972,
    Your case related to Winform Data Controls, So i will move your thread to Windows Forms> Windows
    Forms Data Controls and Databinding  forum for better support.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • File Receiver Adapter:Can't write a large xml file completely

    Hi Folks
    I am doing an IDOC - Xi - FILE scenario where i am writing the xml file as it is onto XI directory.
    The problem i m facing is - the adapter does not write complete file. If i check from AL11 the file i am getting is not exceeding length 660.
    I am not using any content conversion because my requirement is to save xml file as it is.
    This is how it is getting saved:
    <?xml version="1.0" encoding="UTF-8"?>                                                                               
    <ns0:MT_TEST xmlns:ns0="http://test.com/test_sapXi">
    <Account>
    <Account>9899999610</Account>
    <Party>9800000611</Party>
         <Invoice>
              <No>100</No>
              <InvoiceDate>25062010</InvoiceDate>
              <Date>30062010</Date>
              <Total>7</Total>
              <Gross>100</Gross>
              <Net>1000</Net>
                   <Line>
                        <No>100</No>
                        <Date>25062010</Date>
                        <Order>100</Order>
                        <Product>YAG</Product>
                        <Item>100</Item>
                        <Total>7</Total>
                        <Gross>1000</Gross>
    i.e. some tags of <Line> are missing and then closing tags are also missing.          
    Could anyone please help how to extend the length.
    Thanks
    Naina

    So Sorry the structure is like this
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_TEST xmlns:ns0="http://test.com/test_sapXi">
    <Account>
              <Account>9899999610</Account>
              <Party>9800000611</Party>
              <Invoice>
                     <No>100</No>
                     <InvoiceDate>25062010</InvoiceDate>
                     <Date>30062010</Date>
                     <Total>7</Total>
                     <Gross>100</Gross>
                     <Net>1000</Net>
                     <Line>
                            <No>100</No>
                            <Date>25062010</Date>
                            <Order>100</Order>
                            <Product>YAG</Product>
                            <Item>100</Item>
                            <Total>7</Total>
                            <Gross>1000</Gross>
    Shabarish
    I saved the file to .htm from AL11 and saw that this much of the file is getting saved.
    also if i goto communication channel monitoring i could see that in the MESSAGE DISPLAY TOOL it shows
    Write to file "/inbound/xi/107/sss/AB1020100702-132041-124.txt" as text (character encoding US-ASCII) size 660 bytes
    What could be the issue ??
    Naina

  • Setting up a Form Application to write to an XML file on a local computer

    First, I'm using Flash CS3, and Actionscript3.
    I'm trying to set up a data collection form that will save
    the results to a file that can later be imported into a database.
    This is going to be in a Kiosk at a tradeshow and it won't have
    internet access, so I can't send it to an online PHP or ASP, etc,
    script.
    The form also has several screens, so i thought I'd try to
    use the Form Application (I know I can only have one frame on the
    timeline when using this flash template with the data components).
    I want to try and write the data to a XML file. All the information
    I've found is for importing data from an XML file to a web server
    rather than sending data to an XML file on a local computer.
    I'm trying to use the XML connector,and an XML file that
    resides in the same folder as my Flash file, but so far I've had
    very little luck writing to that XML file. Do I need to set up a
    dataset to send the form data to that will then send the data to an
    XML Connector component that will then send the data to the XML
    file. Should I use LoadVars instead, and if I do, will I have to
    write to a script, or can it also write to an XML file.
    If any one has a better idea to do this, please let me know.
    Thanks.

    Hi,
    Flash itself has no filewriting capabilities other then the
    SharedObject
    stuff.
    But why can't you call a php script? You could install
    apache, PHP and
    MYSQL on the computer running the Flash app and get it all
    into the
    database in one go.
    Otherwise you either need to get going with AIR (Adobe
    Integrated
    Runtime), or use a wrapper application like Adobe Director
    (which has
    tons of ways to write to file through it's plethora of
    Xtras.) Director
    may be 'a bit' hard on your budget if you only use it for
    this purpose
    though.
    The XMLSocket is for connections to some server, local or
    remote, not to
    a file.
    Manno
    graphic_pawn wrote:
    > First, I'm using Flash CS3, and Actionscript3.
    >
    > I'm trying to set up a data collection form that will
    save the results to a
    > file that can later be imported into a database. This is
    going to be in a Kiosk
    > at a tradeshow and it won't have internet access, so I
    can't send it to an
    > online PHP or ASP, etc, script.
    >
    > The form also has several screens, so i thought I'd try
    to use the Form
    > Application (I know I can only have one frame on the
    timeline when using this
    > flash template with the data components). I want to try
    and write the data to a
    > XML file. All the information I've found is for
    importing data from an XML file
    > to a web server rather than sending data to an XML file
    on a local computer.
    >
    > I'm trying to use the XML connector,and an XML file that
    resides in the same
    > folder as my Flash file, but so far I've had very little
    luck writing to that
    > XML file. Do I need to set up a dataset to send the form
    data to that will then
    > send the data to an XML Connector component that will
    then send the data to the
    > XML file. Should I use LoadVars instead, and if I do,
    will I have to write to a
    > script, or can it also write to an XML file.
    >
    > If any one has a better idea to do this, please let me
    know.
    >
    > Thanks.
    >
    Manno Bult
    http://www.aloft.nl

  • How to write data to xml file?

    Hi,
    I have done a project which read data from a web then write in log file.
    Now i want to write data in xml file.
    how to write?
    i read some java and xml tutorial, quite quite difficult.
    Who can give a simple example with some comments?
    If you also give some tips on learning java web services, i will be very appreciated.
    Thanks
    Yang Bin

    Choose Xerces2.4 to serialize the DOM object is an option.
    javac XercesTest.java -classpath xmlParserAPIs.jar;xercesImpl.jar;.
    java -classpath xmlParserAPIs.jar;xercesImpl.jar;. XercesTest test.xml
    below is the source file: XercesTest.java
    //JAXP
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    //APACHE SERIALIZE FUNCTION
    import org.apache.xml.serialize.*;
    class XercesTest
    public static void main(String[] args) throws Exception
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse( new File( args[0] ) );
    File f = new File( "copy_of_"+ args[0] );
    OutputFormat format = new OutputFormat("xml","UTF-8",true ) ;
    FileOutputStream fout = new FileOutputStream( f );
    XMLSerializer ser = new XMLSerializer(fout, format );
    ser.serialize( doc );
    hope it's helpful
    land

  • How to write and read Xml file from database if possible?

    Hi all,
    I need to read the .Xml file when receives from Source systems and write the data into the table as well as write in the.xml file thru reading the data from table as per the client needs. I am stranger to this area. Since, please provide some examples how to approach the same.
    Thanks in advance !!
    Regards.
    Vissu.....

    The XML DB forum is better suited to your question.
    It also has a FAQ which details how to read and shred XML into tables as well as other common XML based questions...
    XML DB FAQ

  • How do i create and write to an xml file?

    I know there are methods to create nodes and such but I am not at all familiar with xml. Isn't an easier way just to use the File class to create the file and use the write method to write to the xml file? Thank you.

    tsith wrote:
    <replies>
    <reply>
    <sentence>
    <pronoun>It</pronoun>
    <verb>is</verb>
    </sentence>
    </reply>
    </replies>
    Piddle! Try this: open up Microsoft Word, write "Hello, world!" and save it as XML:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?mso-application progid="Word.Document"?>
    <w:wordDocument
        xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
        xmlns:v="urn:schemas-microsoft-com:vml"
        xmlns:w10="urn:schemas-microsoft-com:office:word"
        xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core"
        xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
        xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
        xmlns:o="urn:schemas-microsoft-com:office:office"
        xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
        xmlns:wsp="http://schemas.microsoft.com/office/word/2003/wordml/sp2"
        w:macrosPresent="no"
        w:embeddedObjPresent="no"
        w:ocxPresent="no"
        xml:space="preserve">
        <w:ignoreElements w:val="http://schemas.microsoft.com/office/word/2003/wordml/sp2"/>
        <o:DocumentProperties>
            <o:Title>Hello, world</o:Title>
            <o:Author>BDLH</o:Author>
            <o:LastAuthor>BDLH</o:LastAuthor>
            <o:Revision>1</o:Revision>
            <o:TotalTime>0</o:TotalTime>
            <o:Created>2008-09-19T17:37:00Z</o:Created>
            <o:LastSaved>2008-09-19T17:37:00Z</o:LastSaved>
            <o:Pages>1</o:Pages>
            <o:Words>2</o:Words>
            <o:Characters>12</o:Characters>
            <o:Company>Weight Watchers</o:Company>
            <o:Lines>1</o:Lines>
            <o:Paragraphs>1</o:Paragraphs>
            <o:CharactersWithSpaces>13</o:CharactersWithSpaces>
            <o:Version>11.0000</o:Version>
        </o:DocumentProperties>
        <w:fonts>
            <w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/>
        </w:fonts>
        <w:styles>
            <w:versionOfBuiltInStylenames w:val="4"/>
            <w:latentStyles w:defLockedState="off" w:latentStyleCount="156"/>
            <w:style w:type="paragraph" w:default="on" w:styleId="Normal">
                <w:name w:val="Normal"/>
                <w:rPr>
                    <wx:font wx:val="Times New Roman"/>
                    <w:sz w:val="24"/>
                    <w:sz-cs w:val="24"/>
                    <w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA"/>
                </w:rPr>
            </w:style>
            <w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont">
                <w:name w:val="Default Paragraph Font"/>
                <w:semiHidden/>
            </w:style>
            <w:style w:type="table" w:default="on" w:styleId="TableNormal">
                <w:name w:val="Normal Table"/><wx:uiName wx:val="Table Normal"/>
                <w:semiHidden/>
                <w:rPr>
                    <wx:font wx:val="Times New Roman"/>
                </w:rPr>
                <w:tblPr>
                    <w:tblInd w:w="0" w:type="dxa"/>
                    <w:tblCellMar>
                        <w:top w:w="0" w:type="dxa"/>
                        <w:left w:w="108" w:type="dxa"/>
                        <w:bottom w:w="0" w:type="dxa"/>
                        <w:right w:w="108" w:type="dxa"/>
                    </w:tblCellMar>
                </w:tblPr>
            </w:style>
            <w:style w:type="list" w:default="on" w:styleId="NoList">
                <w:name w:val="No List"/>
                <w:semiHidden/>
            </w:style>
        </w:styles>
        <w:docPr>
            <w:view w:val="print"/>
            <w:zoom w:percent="100"/>
            <w:doNotEmbedSystemFonts/>
            <w:proofState w:spelling="clean" w:grammar="clean"/>
            <w:attachedTemplate w:val=""/>
            <w:defaultTabStop w:val="720"/>
            <w:punctuationKerning/>
            <w:characterSpacingControl w:val="DontCompress"/>
            <w:optimizeForBrowser/>
            <w:validateAgainstSchema/>
            <w:saveInvalidXML w:val="off"/>
            <w:ignoreMixedContent w:val="off"/>
            <w:alwaysShowPlaceholderText w:val="off"/>
            <w:compat>
                <w:breakWrappedTables/>
                <w:snapToGridInCell/>
                <w:wrapTextWithPunct/>
                <w:useAsianBreakRules/>
                <w:dontGrowAutofit/>
            </w:compat>
            <wsp:rsids>
                <wsp:rsidRoot wsp:val="0077226E"/>
                <wsp:rsid wsp:val="0077226E"/>
            </wsp:rsids>
        </w:docPr>
        <w:body>
            <wx:sect>
                <w:p wsp:rsidR="0077226E" wsp:rsidRDefault="0077226E">
                    <w:r>
                        <w:t>Hello, world!</w:t>
                    </w:r>
                </w:p>
                <w:sectPr wsp:rsidR="0077226E">
                    <w:pgSz w:w="12240" w:h="15840"/>
                    <w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="708" w:footer="708" w:gutter="0"/>
                    <w:cols w:space="708"/>
                    <w:docGrid w:line-pitch="360"/>
                </w:sectPr>
            </wx:sect>
        </w:body>
    </w:wordDocument>

  • Can we write query for fomatted search without from clause

    can we write query for fomatted search without from clause as below.
    SELECT (($(u_amt)*14)/100)
    here U_amt is a UDF .I want to assign this to another field .
    Rgds,
    Rajeev

    Hi Rajeev,
    You can write query for FMS without from.  That is because you can omit it when you get value from active form by default.  The grammar of it is:
    Select $[$38.u_amt.0\] * 14/100 in your case if you have item type marketing document @line level.
    From View-System Information, you can get the info you need for your FMS query at the left bottom of your screen.
    Thanks,
    Gordon

  • How can I write relative path in File, ImageIcon objects

    I have downloaded examples from
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-swing/index.html
    but for some reason images are invisible until I write absolute paths?(I use windows) How can I write relative path in File, ImageIcon objects?

    Hello;
    I've found a lot of complaints about this through the Forte forum as well as on Dejanews. I'm just curious as to whether any of you ended up finding a solution to this problem.
    There was one posting about setting up the subdirectory as a URL rather than a String and then using that as the source of the ImageIcon ... but this didn't work for me.
    Any help whatsoever would be appreciated.
    Thanks!

  • Can execut a query in Oracle UCM to get View_Values instead of using GET_SC

    Dear All,
    i have a question that i had google it and didn't find anything helpful.
    i want to ask if i can execut a query in Oracle UCM to get View_Values instead of using GET_SCHEMA_VIEW_VLAUES service ?
    ie: asuume that we have a Table name called Employees (having empId, empName) and have a view named as Table name; Employees.
    instead of use the GET_SCHEMA_VIEW_VLAUES service to get the data of Employees, can i write a query, ex: select from Employees*_ to get the data.
    note: i have a connection parameter to connect to oracle UCM database
    any suggestions.
    Regards

    Yes, you can execute the query and store results into a result set (available also in iDocScript).
    There are two sample components that you could use as a starting point - see here http://www.oracle.com/technetwork/middleware/webcenter/content/howtocomponentsbundle-132171.zip or here for 11g http://bexhuff.com/2011/03/howto-component-samples-for-oracle-ucm-11g
    Take a look at DataAccess and DatabaseProvider from the sample stack.

  • Import an xml file into adobe designer field using javascript

    Adobe javascript experts ,please help me.
    I need to load the data from an xml file into a text field in designer
    using javascript and then go through each node in the loaded xml and compare that with form fields in designer and if matching fill the value(node's value from the loaded xml) in form fields.
    Please give ur suggestions.
    Thanks in advance!!!
    regards,
    sowmya

    Thanks for the fast response.
    I saw your example and specifically the javascript code
    xfa.host.importData("filename.xml").
    Just by giving this alone how do I access the values in the xml???
    Just by giving the above javascript, my value is not getting populated when I see in pdf preview.
    But apart from that you have done dataconnection also and binding in all the columns.What is this for??
    Could you kindly explain what u r doing step by step??
    Thanks again.
    regards,
    Sowmya

  • I need one XML File containing one Idoc fields Say Orders01

    hiall,
    i need one XML File containing one Idoc fields Say Orders01
    bye
    satish

    hi,
    <?xml version="1.0" encoding="iso-8859-1"?>
    <ORDERS02>
      <IDOC BEGIN="1">
        <EDI_DC40 SEGMENT="1">
          <TABNAM>EDI_DC40</TABNAM>
          <MANDT>800</MANDT>
          <DOCNUM>0000000000213213</DOCNUM>
          <DOCREL>46B</DOCREL>
          <STATUS>30</STATUS>
          <DOCTYP>ORDERS02</DOCTYP>
          <DIRECT>1</DIRECT>
          <RCVPOR>A000000032</RCVPOR>
          <RCVPRT>LS</RCVPRT>
          <RCVPRN>sell</RCVPRN>
          <RCVSAD/>
          <RCVLAD/>
          <STD/>
          <STDVRS/>
          <STDMES/>
          <MESCOD/>
          <MESFCT/>
          <OUTMOD>4</OUTMOD>
          <TEST/>
          <SNDPOR>SAPSID</SNDPOR>
          <SNDPRT>KU</SNDPRT>
          <SNDPRN>23334</SNDPRN>
          <SNDSAD/>
          <SNDLAD/>
          <REFINT/>
          <REFGRP/>
          <REFMES/>
          <ARCKEY/>
          <CREDAT>20061019</CREDAT>
          <CRETIM>205734</CRETIM>
          <MESTYP>ORDERS</MESTYP>
          <IDOCTYP>ORDERS02</IDOCTYP>
          <CIMTYP/>
          <RCVPFC/>
          <SNDPFC/>
          <SERIAL></SERIAL>
          <EXPRSS/>
        </EDI_DC40>
        <E1EDK01 SEGMENT="1">
          <KZABS>X</KZABS>
          <CURCY>USD</CURCY>
          <WKURS>1.000</WKURS>
          <ZTERM>ZZZZ</ZTERM>
          <BSART>EC</BSART>
          <BELNR>300024455</BELNR>
          <RECIPNT_NO>misssa</RECIPNT_NO>
        </E1EDK01>
        <E1EDK14 SEGMENT="1">
          <QUALF>014</QUALF>
          <ORGID>1000</ORGID>
        </E1EDK14>
        <E1EDK14 SEGMENT="1">
          <QUALF>009</QUALF>
          <ORGID>001</ORGID>
        </E1EDK14>
        <E1EDK14 SEGMENT="1">
          <QUALF>011</QUALF>
          <ORGID>1000</ORGID>
        </E1EDK14>
        <E1EDK03 SEGMENT="1">
          <IDDAT>012</IDDAT>
          <DATUM>20061019</DATUM>
        </E1EDK03>
        <E1EDKA1 SEGMENT="1">
          <PARVW>LF</PARVW>
          <PARTN>000002344</PARTN>
          <TELF1></TELF1>
          <BNAME></BNAME>
        </E1EDKA1>
        <E1EDKA1 SEGMENT="1">
          <PARVW>WE</PARVW>
          <LIFNR>1000</LIFNR>
          <NAME1></NAME1>
          <STRAS></STRAS>
          <ORT01></ORT01>
          <PSTLZ>4444</PSTLZ>
          <LAND1>EN</LAND1>
          <TELF1></TELF1>
          <SPRAS>D</SPRAS>
          <ORT02></ORT02>
          <REGIO>02</REGIO>
        </E1EDKA1>
        <E1EDK02 SEGMENT="1">
          <QUALF>001</QUALF>
          <BELNR>600060324</BELNR>
          <DATUM>20061019</DATUM>
          <UZEIT>205736</UZEIT>
        </E1EDK02>
        <E1EDK17 SEGMENT="1">
          <QUALF>001</QUALF>
          <LKOND>EXW</LKOND>
          <LKTEXT>london</LKTEXT>
        </E1EDK17>
        <E1EDK18 SEGMENT="1">
          <QUALF>001</QUALF>
          <TAGE>12</TAGE>
          <PRZNT>4.000</PRZNT>
        </E1EDK18>
        <E1EDK18 SEGMENT="1">
          <QUALF>002</QUALF>
          <TAGE>30</TAGE>
          <PRZNT>2.000</PRZNT>
        </E1EDK18>
        <E1EDK18 SEGMENT="1">
          <QUALF>003</QUALF>
          <TAGE>45</TAGE>
        </E1EDK18>
        <E1EDP01 SEGMENT="1">
          <POSEX>00010</POSEX>
          <PSTYP>0</PSTYP>
          <KZABS>X</KZABS>
          <MENGE>1.000</MENGE>
          <MENEE>EA</MENEE>
          <BMNG2>1.000</BMNG2>
          <PMENE>EA</PMENE>
          <VPREI>3</VPREI>
          <PEINH>1</PEINH>
          <NETWR>3</NETWR>
          <MATKL>001</MATKL>
          <BPUMN>1</BPUMN>
          <BPUMZ>1</BPUMZ>
          <E1EDP20 SEGMENT="1">
            <WMENG>1.000</WMENG>
            <EDATU>19</EDATU>
          </E1EDP20>
          <E1EDP19 SEGMENT="1">
            <QUALF>002</QUALF>
            <IDTNR>100</IDTNR>
          </E1EDP19>
          <E1EDP19 SEGMENT="1">
            <QUALF>001</QUALF>
            <KTEXT>some text</KTEXT>
          </E1EDP19>
        </E1EDP01>
        <E1EDS01 SEGMENT="1">
          <SUMID>002</SUMID>
          <SUMME>3</SUMME>
          <SUNIT>USD</SUNIT>
        </E1EDS01>
      </IDOC>
    </ORDERS02>
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Which API can be used to write to an XML file(web.xml) programmatically

    Hi,
    I wish to write to the web.xml file programmatically.Could anyone point me to the
    API that is to be used.
    I am aware of the API to be used for extracting the node and the tag values - com.bea.p13n.xml.util.DomHelper
    but this class has only getters and I wish to know which API should be used to set
    the xml nodes.
    It is important and am looking forward to pointers.
    Thanks in advance!
    Regards,
    Shikha

    S. Bajaj
    org.w3c.dom Api
    Deepak
    shikha wrote:
    Hi,
    I wish to write to the web.xml file programmatically.Could anyone point me to the
    API that is to be used.
    I am aware of the API to be used for extracting the node and the tag values - com.bea.p13n.xml.util.DomHelper
    but this class has only getters and I wish to know which API should be used to set
    the xml nodes.
    I am unable to find answer to this.
    Looking forward to pointers and help.
    Thanks in advance!
    Regards,
    Shikha

  • JSP Servlet and convert the result set of an SQL Query To XML file

    Hi all
    I have a problem to export my SQL query is resulty into an XML file I had fixed my servlet and JSP so that i can display all the records into my database and that the goal .Now I want to get the result set into JSP so that i can create an XML file from that result set from the jsp code.
    thisis my servlet which will call the jsp page and the jsp just behind it.
    //this is the servlet
    import java.io.*;
    import java.lang.reflect.Array;
    import java.sql.*;
    import java.util.ArrayList;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.naming.*;
    import javax.sql.*;
    public *class *Campaign *extends *HttpServlet
    *private* *final* *static* Logger +log+ = Logger.+getLogger+(Campaign.*class*.getName());
    *private* *final* *static* String +DATASOURCE_NAME+ = "jdbc/SampleDB";
    *private* DataSource _dataSource;
    *public* *void* setDataSource(DataSource dataSource)
    _dataSource = dataSource;
    *public* DataSource getDataSource()
    *return* _dataSource;
    *public* *void* init()
    *throws* ServletException
    *if* (_dataSource == *null*) {
    *try* {
    Context env = (Context) *new* InitialContext().lookup("java:comp/env");
    _dataSource = (DataSource) env.lookup(+DATASOURCE_NAME+);
    *if* (_dataSource == *null*)
    *throw* *new* ServletException("`" + +DATASOURCE_NAME+ + "' is an unknown DataSource");
    } *catch* (NamingException e) {
    *throw* *new* ServletException(e);
    protected *void *doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    Connection conn = *null*;
    *try* {
    conn = getDataSource().getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("select post_id,comments,postname from app.posts");
    // out.println("Le r&eacute;sultat :<br>");
    ArrayList <String> Lescomments= *new* ArrayList<String>();
    ArrayList <String> Lesidentifiant = *new* ArrayList<String>();
    ArrayList <String> Lesnoms = *new* ArrayList <String>();
    *while* (rs.next()) {
    Lescomments.add(rs.getString("comments"));
    request.setAttribute("comments",Lescomments);
    Lesidentifiant.add(rs.getString("post_id"));
    request.setAttribute("id",Lesidentifiant);
    Lesnoms.add(rs.getString("postname"));
    request.setAttribute("nom",Lesnoms);
    rs.close();
    stmt.close();
    *catch* (SQLException e) {
    *finally* {
    *try* {
    *if* (conn != *null*)
    conn.close();
    *catch* (SQLException e) {
    // les param&egrave;tres sont corrects - on envoie la page r&eacute;ponse
    getServletContext().getRequestDispatcher("/Campaign.jsp").forward(request,response);
    }///end of servlet
    }///this is the jsp page called
    <%@ page import="java.util.ArrayList" %>
    <%
    // on r&eacute;cup&egrave;re les donn&eacute;es
    ArrayList nom=(ArrayList)request.getAttribute("nom");
    ArrayList id=(ArrayList)request.getAttribute("id");
    ArrayList comments=(ArrayList) request.getAttribute("comments");
    %>
    <html>
    <head>
    <title></title>
    </head>
    <body>
    Liste des campagnes here i will create the xml file the problem is to display all rows
    <hr>
    <table>
    <tr>
    </tr>
    <tr>
    <td>Comment</td>
    <td>
    <%
    for( int i=0;i<comments.size();i++){
    out.print("<li>" + (String) comments.get(i) + "</li>\n");
    }//for
    %>
    </tr>
    <tr>
    <td>nom</td>
    <td>
    <%
    for( int i=0;i<nom.size();i++){
    out.print("<li>" + (String) nom.get(i) + "</li>\n");
    }//for
    %>
    </tr>
    <tr>
    <td>id</td>
    <td>
    <%
    for( int i=0;i<id.size();i++){
    out.print("<li>" + (String) id.get(i) + "</li>\n");
    }//for
    %>
    </tr>
    </table>
    </body>
    </html>
    This is how i used to create an XML file in a JSP page only without JSP/SERVLET concept:
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%
    // Identify a carriage return character for each output line
    int iLf = 10;
    char cLf = (*char*)iLf;
    // Create a new empty binary file, which will content XML output
    File outputFile = *new* File("C:\\Users\\user\\workspace1\\demo\\WebContent\\YourFileName.xml");
    //outputFile.createNewFile();
    FileWriter outfile = *new* FileWriter(outputFile);
    // the header for XML file
    outfile.write("<?xml version='1.0' encoding='ISO-8859-1'?>"+cLf);
    try {
    // Define connection string and make a connection to database
    Connection conn = DriverManager.getConnection("jdbc:derby://localhost:1527/SAMPLE","app","app");
    Statement stat = conn.createStatement();
    // Create a recordset
    ResultSet rset = stat.executeQuery("Select * From posts");
    // Expecting at least one record
    *if*( !rset.next() ) {
    *throw* *new* IllegalArgumentException("No data found for the posts table");
    outfile.write("<Table>"+cLf);
    // Parse our recordset
    // Parse our recordset
    *while*(rset.next()) {
    outfile.write("<posts>"+cLf);
    outfile.write("<postname>" + rset.getString("postname") +"</postname>"+cLf);
    outfile.write("<comments>" + rset.getString("comments") +"</comments>"+cLf);
    outfile.write("</posts>"+cLf);
    outfile.write("</Table>"+cLf);
    // Everything must be closed
    rset.close();
    stat.close();
    conn.close();
    outfile.close();
    catch( Exception er ) {
    %>

    Please state your problem that you are having more clearly so we can help.
    I looked at your code I here are a few things you might consider:
    It looks like you are putting freely typed-in comments from end-users into an xml document.
    The problem with this is that the user may enter characters in his text that have special meaning
    to xml and will have to be escaped correctly. Some of these characters are less than character, greater than character and ampersand character.
    You may also have a similiar problem displaying them on your JSP page since there may be special characters that JSP has.
    You will have to read up on how to deal with these special characters (I dont remember what the rules are). I seem to recall
    if you use CDATA in your xml, you dont have to deal with those characters (I may be wrong).
    When you finish writing your code, test it by entering all keyboard characters to make sure they are processed, stored in the database,
    and re-displayed correctly.
    Also, it looks like you are putting business logic in your JSP page (creating an xml file).
    The JSP page is for displaying data ONLY and submitting back to a servlet. Put all your business logic in the servlet. Putting business logic in JSP is considered bad coding and will cause you many hours of headache trying to debug it. Also note: java scriptlets in a JSP page are only run when the JSP page is compiled into a servlet by java. It does not run after its compiled and therefore you cant call java functions after the JSP page is displayed to the client.

  • How can I load the selected XML File (Selected from a Listview) into the correct Textboxes?

    Right, so I have a windowsform with lots of Textboxes, where the user can type in Information, and then hit "Save", once its saved it goes into a sortof XML Format 
    <?xml version="1.0" encoding="utf-8"?>
    <!--Database-->
    <Case>
      <Person>l<Driver></Driver><License-Holder></License-Holder><Address></Address><Phone></Phone><Date-of-Birth></Date-of-Birth><Registration></Registration>
    Like that.
    Now, on my Startup Form (The main form) there is a Listview that I gave the name Objectlist1. This list displays ANY file located in a specific folder on my computer. This is also where the Saved files appear.
    The list also updates every 5th second so after you save it appears quickly.
    Now, the Files are saved using the content or Value of the first Textbox:
    Dim XmlWrt As XmlWriter = XmlWriter.Create("C:\Users\USER\Desktop\TESTFOLDER\" + Firsttextbox.Text, settings)
    So it appears in the folder and on the list with the value inserted in the first Textbox.
    My problem comes when I want to load this back (Or reverse the function if you will)
    Where I can go to the Objectlist1/Listview, either doubleclick a file or Mark a file, and hit my button "Retrieve"
    I want the Form where you could input all the values to show - which it does
    And the information from the XML/File saved to appear where it once was typed or inserted.
    Here is an example of the code used to save the values from the Textboxes;
    Private Sub Savebutton_Click(sender As Object, e As EventArgs) Handles Savebutton.Click
            If IO.File.Exists(Pholderbox.Text) = False Then
                Dim settings As New XmlWriterSettings()
                settings.Indent = True
                Dim XmlWrt As XmlWriter = XmlWriter.Create("C:\Users\USER\Desktop\TESTFOLDER\" + Pholderbox.Text, settings)
                With XmlWrt
                    ' Write the Xml declaration.
                    .WriteStartDocument()
                    ' CLIENT
                    ' Write a comment.
                    .WriteComment("Database")
                    ' Write the root element.
                    .WriteStartElement("Case")
                    ' Start our first person.
                    .WriteStartElement("Person")
                    .WriteString(Textbox1.Text)
                    ' The person nodes.
                    .WriteStartElement("Driver")
                    .WriteString(Textbox2.Text)
                    .WriteEndElement()
    I've tried multiple codesamples but they all give either "XML Not found" or such Overloads.
    This is the current code I used when trying to make it work
    Private Function ReadSettingsXML(ByVal path As String) As MySettings # On Debug It marks here and tells me it wasn't found.
            Dim thisSettingsInfo As New MySettings
            If My.Computer.FileSystem.FileExists(Objectlist1.SelectedItems.ToString) Then
                Dim settingsInfo = XElement.Load(Objectlist1.SelectedItems.ToString)
                If settingsInfo IsNot Nothing Then
                    For Each mainGroup As XElement In settingsInfo.Elements
                        If mainGroup.Name = "<Database>" AndAlso mainGroup.HasElements Then
                            For Each subGroup As XElement In mainGroup.Elements
                                If subGroup.Name = "<Person>" Then
                                    thisSettingsInfo.Textbox1 = subGroup.Value
                                ElseIf subGroup.Name = "<Driver>" Then
                                    thisSettingsInfo.Textbox2 = subGroup.Value
                                ElseIf subGroup.Name = "<Address>" Then
                                    thisSettingsInfo.Textbox3 = subGroup.Value
                                End If
                            Next
                        End If
                    Next
                Else
                    thisSettingsInfo = Nothing
                    Throw New Exception("The settings XML file is corrupt and cannot be read.")
                End If
            Else
                thisSettingsInfo = Nothing
                Throw New Exception("The settings XML file could not be located.")
            End If
            Return thisSettingsInfo
        End Function
        Private Sub LoadXML_Click(sender As Object, e As EventArgs) Handles LoadXML.Click
            Dim settings As New MySettings
            settings = ReadSettingsXML(Objectlist1.SelectedItems.ToString)
            If settings IsNot Nothing Then
                Dim sb As New System.Text.StringBuilder
                With settings
                    Caseworker.Textbox1.Text = .Person
                    Caseworker.Textbox2.Text = .Driver
                    Caseworker.Textbox3.Text = .Address
                End With
            End If
        End Sub
    Also, the "Caseworker" is the form where all the textboxes are located.
    Been stuck on this for two working days, so any help is highly appreciated 
    Codesamples are also highly welcome so I can see what the heck you did and find and answer to my problems.

    I found a code that might be close to what I'm looking, but as of this code used here, it looks for a static document that already exist and is located in the code.
    See this one here, checks for the XML file, and since I can't link one program to 1 file, when its gonna have and use 100's of files.
            If (IO.File.Exists("MyXML.xml")) Then
                Same here with the static document.
                Dim document As XmlReader = New XmlTextReader("MyXML.xml")
                While (document.Read())
                    Dim type = document.NodeType
                    'if node type was element
                    If (type = XmlNodeType.Element) Then
                        If (document.Name = "FirstName") Then
                            TextBox1.Text = document.ReadInnerXml.ToString()
                        End If
                        If (document.Name = "LastName") Then
                            TextBox2.Text = document.ReadInnerXml.ToString()
                        End If
                    End If
                End While
    Am I at least close here, people? 
    Can anyone help with the now critical issue I got?
    I basically need to change these two;
     If (IO.File.Exists("MyXML.xml")) Then
                Same here with the static document.
                Dim document As XmlReader = New XmlTextReader("MyXML.xml")
    To whatever value, so they read from the file SELECTED in my Listview
    Cos the program saves files according to the info inserted in textboxes, so it can have whatever name you can think of, I need the program to "find and load" that file, once its selected, and then once I hit Retrieve or LOAD or whatever button, it
    injects the info from the File to the correct Textboxes.
    And I think this will work to get the info in the right boxes;
     If (document.Name = "FirstName") Then
                            TextBox1.Text = document.ReadInnerXml.ToString()
                        End If
                        If (document.Name = "LastName") Then
                            TextBox2.Text = document.ReadInnerXml.ToString()
    Any good advise? I'm stranded here.

Maybe you are looking for

  • Any way to store if a user visited a slide?

    Hi! NewB here. I was wondering if there is a way to know whether a user has visited a certain slide or not. I was thinking along the lines of a variable, although I don't see a direct shot to coding. I do see that JavaScript (JS) is available. I have

  • Can I integrate HTML DB with 11.5.8 applications/9.2.0.6 database

    We are using Oracle applications 11.5.8. We have 9iAS 1.0.2.2 Our database is 9.2.0.6 I see that you can use HTML DB/ application express with 9.2.0.6 database. I am unsure if i would install it in my 9iAS home or if i would install it in a new home?

  • HT4589 How can I share a video shot at 60 fps.  Quick time error 0 and 50 occur for  DVD

    Change camera settings to 60 fps and now program will not share to DVD.  Getting quicktime error 0 for DVD and error 50 on master file.  Seems Quicktime cannot handle 60 fps. Is there a way I can solve this problem?  Camera setting will go back to 30

  • N97 - No log-in from the VOIP service menu

    I am stuck though I have followed Nokia's procedure for configuring my phone for VOIP calls: Log-in from the VOIP service menu doesn't happen. My SIP-profile is registered. However, I have two VOIP services defined (two globes) with the same name as

  • Dropped frame ****

    I've had the same problem for a couple of years and I wondered if anyone could help When I output my final programmes from FCP to DVCAM tape, I almost always end up with what i think are dropped frames like small juders, which causes the programme to