Basic XML Question

Hi,
I want to be able to create XML documents from my oracle database using PLSQL and then receive XML documents with XML as well into the database. What exactly do I need to use/setup/configure?
I take it I need to use jdeveloper and the oracle 10g xdk? Or can I just use all internal Oracle functionality?
Thanks in advance
Edited by: goochable on Sep 16, 2009 9:38 PM

I read the SUN tutorials on using the DOM parser. I chose to use the DOM parser instead of the SAX parser, because it is simple to load a file and let the API parse the xml file from you. Then all you need to do is call the various methods that are provided to access parts of your XML file.
For example, here is the function I use to load my config file, which I grabbed from the examples in the SUN XML tutorial. See part III of:
http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/index.html
public boolean loadFile(String filename) {
     // Get an instance of a DocumentBuilderFactor
        DocumentBuilderFactory  factory = DocumentBuilderFactory.newInstance();
     try {
            // Have the factory create a document builder
            DocumentBuilder builder = factory.newDocumentBuilder();
            // Builder parses the XML file and save it into a document object.
            xmlFile = builder.parse( filename );
            return true;
     catch (SAXException sxe) {
            // Error generated during parsing.
            Exception  x = sxe;
            if (sxe.getException() != null) x = sxe.getException();
            x.printStackTrace();
            return false;
     catch (ParserConfigurationException pce) {
            // Parser with specified options can't be built.
            pce.printStackTrace();
          catch (IOException ioe) {
           // I/O error
        System.out.println("XMLEasyReader: Error opening the config file : " + filename);
           ioe.printStackTrace();
     return false;
    }

Similar Messages

  • Follow-up Basic XML Questions

    First, I apologize to the board in advance because I started a very similar topic already. I know this can be annoying but I think I'm worried that people will ignore my original post because there was already a reply to it. I added 2 follow up posts and nobody has responded. It could well be because they feel that my questions were already answered. After reading and re-reading the person who replied to my original question I did start to pick up many answers from his post. However, I guess I have some follow-up questions and felt compelled to start a new thread to get this "out there" again. I promise to try not to do this again and, once again, I apologize for starting multiple similar topics. Anyway, here goes my follow-up questions...
    I'm pretty new to XML but I've been reading an article on msdn about it and listed some code from the article at the bottom of this post.
    I have some questions about namespaces. From what I understand, a namespace is a unique identifier (it's a string). The thing that's bugging me though is this line...
    <x:transform version='1.0' xmlns:x='http://www.w3.org/1999/XSL/Transform'>
    Maybe I'm wrong, but my gut feeling is that this particular namespace has a special meaning (in other words, it goes beyond being just a unique identifier). Am I correct on this?
    From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically. I've read that a schema can be "namespace aware". So, as a guess at the answer to my original question - are there certain namespaces that are something like "keywords" (similar to the concept of "keywords" in programming languages)? And is the "big deal" about these particular namespaces that they have schema definitions attached to them somehow? Any help would be GREATLY appreciated!
    EXAMPLE CODE FROM THE MSDN SITE:
    <x:transform version='1.0'
    xmlns:x='http://www.w3.org/1999/XSL/Transform'
    >
    <x:template match='/'>
    <hello_world/>
    </x:template>
    </x:transform>

    this particular namespace has a special meaning .... Am I correct on this?Yes, that namespace has a "meaning", but only to a program that implements the XSLT language. Likewise a "purchase order" namespace has a "meaning", but only to a program that is designed to read XML with that namespace and convert it to purchase orders in somebody's accounting system. (Just as the codes 'A', 'C', and 'D' could mean 'Add', 'Change', and 'Delete' to a program that maintains a database.) Similarly element names have a "meaning", but only to a program that is designed to understand that "meaning". A Java program has a "meaning" but a COBOL compiler doesn't understand that "meaning".
    From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically.Not that I've ever heard of.

  • Basic XML question: Purpose of a DTD?

    What does a DTD do? And do I need one? I've been using an XML config file for my app, but now that I'm looking for a simple XML editor, I can't just open my .xml file in the editor and GO. I need to specify some kind of DTD as well, so I can't even edit my file as I do in Forte.
    Thanks

    I read the SUN tutorials on using the DOM parser. I chose to use the DOM parser instead of the SAX parser, because it is simple to load a file and let the API parse the xml file from you. Then all you need to do is call the various methods that are provided to access parts of your XML file.
    For example, here is the function I use to load my config file, which I grabbed from the examples in the SUN XML tutorial. See part III of:
    http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/index.html
    public boolean loadFile(String filename) {
         // Get an instance of a DocumentBuilderFactor
            DocumentBuilderFactory  factory = DocumentBuilderFactory.newInstance();
         try {
                // Have the factory create a document builder
                DocumentBuilder builder = factory.newDocumentBuilder();
                // Builder parses the XML file and save it into a document object.
                xmlFile = builder.parse( filename );
                return true;
         catch (SAXException sxe) {
                // Error generated during parsing.
                Exception  x = sxe;
                if (sxe.getException() != null) x = sxe.getException();
                x.printStackTrace();
                return false;
         catch (ParserConfigurationException pce) {
                // Parser with specified options can't be built.
                pce.printStackTrace();
              catch (IOException ioe) {
               // I/O error
            System.out.println("XMLEasyReader: Error opening the config file : " + filename);
               ioe.printStackTrace();
         return false;
        }

  • Spry Repeat/XML question

    I am in desperate need of help.
    Here is the path to my html file.
    http://www.3hounddesign.com/WoodsWoods/gallery/index.html
    When you look at it, you see the navigation list on the left
    (Adobe, SF Symphony, Fiery, etc). This list corresponds to the
    images that you see. However some of the navigation items (Adobe,
    Apple, Levi Strauss) have more than one image associated with them.
    I want to be able to use the arrows at the bottom of the page to
    click through to the second image, but not have it show up on the
    navigation list. For example, I only want Adobe to show up once on
    the navigation list, even though I have 2 different adobe photos,
    and thus have created 2 different XML entries for Adobe.
    http://www.3hounddesign.com/WoodsWoods/gallery/galleries/woods/photos.xml
    The first entry has the Adobe title, while I left the second
    one blank. However this leaves a blank space on the navigation
    list.
    Unfortunately I know very little about javascript and am just
    learning about this spry stuff and am very confused, and therefore
    created this stuff by altering the adobe gallery demo
    I also have a version I created by altering the adobe
    products demo (
    http://www.3hounddesign.com/Paul_Woods/identity.html#)
    However that has problems of its own, so I would rather stick
    with my alteration of the gallery demo.
    So basically my question...Is there any way that I can have
    the navigation only show one entry for Adobe (and Apple and Levi)
    yet still have two images there?
    Sadly, I am desperate need of an answer ASAP, as a current
    job I am working on depends on it, and I don’t want to have
    to resort to iframes.
    Please please someone help me!

    Hi,
    I looked over you code and I noticed that you have the image
    src added on the left side.
    You have this <img
    src="galleries/{dsGalleries::@base}{dsGallery::thumbnail/@base}{@thumbpath}"
    alt="{@thumbpath}" name="tn{ds_RowID}" width="89" height="15"
    id="tn{ds_RowID}" style="left: -77px; right: 0px;" />
    You don't need to have the image added on the left side,
    because you want there only the title (Adobe, SF Symphony...)
    So you should replace the img with a div for example:
    <div style="width:89px; height:15px;left: -77px; right:
    0px;" id="tn{ds_RowID}" >{@thumbpath}</div>
    The reason why you have an empty space after Adobe item is
    that on you xml you have an empty alt attribute.
    To display only the thumbpaths that are not empty you can add
    an spry:if condition.
    So the above div becomes:
    <div style="width:89px; height:15px;left: -77px; right:
    0px;" id="tn{ds_RowID}" spry:if="{@thumbpath}" != ""
    >{@thumbpath}</div>
    This says if thumbpath is not empty display it.
    I aslo load you page in IE and I noticed that the left menu
    is not displayed.
    Diana

  • Basic iPhoto questions:

    I have some Basic iPhoto questions before I start using the program:
    - does iPhoto apply any compression or change images in any way when they
    are imported?
    - after images are imported, can the original source folder of images be deleted off of the mac?
    - can Quicktime files exported from iPhoto be viewed on a Windows computer?
    - can iPhoto handle large resolution images that might be as large as 8-15mb each? does it display them quick? are there any known file size issues?
    Thanks!!!!

    kat.
    Is there a way to use iPhoto on a network so other users can read and possibly write to an iPhoto library on a networked mac?
    iPhoto is a consumer level photo organiser, not a server. It's possible to share photos but libraries are very difficult and fraught with the danger of database corruption. Some have reported success.
    Is it possible to password protect or secure certain images in the library so they can not be seen by anyone?
    No. The best I can suggest there is to create a second library and store it in a secure area like a protected dmg. But remember, you can only have one library open at a time.
    After photos are deleted from iPhoto, are there any remaining traces or cached files anywhere other than the trash
    If you delete photos from iPhoto and empty the iPhoto trash then the pics are removed from the Finder as well. They remain as findable as any other deleted file from that point, which is, very, if the searcher in knowledgeable.
    Regards
    TD

  • Object class deployment - Basic form question

    OK, I subclass calendar object from Oracle provided standard
    object class. What do I need to deploy to use this form now
    apart from calendar.pll and my fmx. What about the object class
    from which I sub-class. Do I need to compile and deploy that
    also? How will form resolve this on run time the parent object
    class as I really did not copy, just sub class and we do not
    deploy original class? Basic form question. Thanks.

    You can set the "help" property on the field (which gives you the little "information" icon link beside the field).
    You could also try adding another field of another class above or below:
    <Display class='InlineAlert'/>
    <Display class='ErrorMessage'/>
    <Display class='HtmlPage'/>
    ..etc
    -Rob

  • Adding Date/Time Field + X Number of Days - Basic Calculation Question

    I am assuming this is a basic calculation question. New to Adobe LiveCycle Forms.
    I have a simple form containing a table. The table appears as such:
    Text
    Formatted as Date/Time Fields
    Header 3
    Monday
    user wil choose the beginning date (Date/Time) this is DateTimeField1
    Tuesday
    this should calculate DateTimeField1 + 1
    Wednesday
    this should calculate DateTimeField1 + 2
    Thursday
    this should calculate DateTimeField1 + 3
    Friday
    this should calculate DateTimeField1 + 4
    Saturday
    this should calculate DateTimeField1 + 5
    Sunday
    this should calculate DateTimeField1 + 6
    Calculations are performed after the date is chosen for Monday. My mind tells me the simple calculation of DateTimeField1 + 1 is not going to work (and in fact doesn't!) as it needs to change Monday to a number first. I saw on another thread the following:
    Num2Date(Date2Num(Date(DateTimeField1), "DD.MM.YYYY")+7, "DD.MM.YYYY")
    Thought this was going to get me close. No cigars though!
    Any quick help is greatly appreciated. And since I am new to this, details about what needs to be changed would be great too!
    Thanks

    Here an addition for you date field.
    This FormCalc script in the exit:Event will check it the selected date is on a monday.
    If not it will go the days back until the last monday.
    var Selection = Date2Num($.formattedValue, DateFmt(2))
    var WeekDay = Num2Date(Selection, "E")
    var NewDate
    if (WeekDay eq 1) then
              NewDate = Selection - 6
    elseif (WeekDay eq 3) then
              NewDate = Selection - 1
    elseif (WeekDay eq 4) then
              NewDate = Selection - 2
    elseif (WeekDay eq 5) then
              NewDate = Selection - 3
    elseif (WeekDay eq 6) then
              NewDate = Selection - 4
    elseif (WeekDay eq 7) then
              NewDate = Selection - 5
    else
              NewDate = Selection
    endif
    $ = Num2Date(NewDate, "EEE DD.MM.YYYY")
    Hope this helps, too.

  • Where to ask XML-questions

    Hello,
    when I have a question about XML, where do I ask?
    XML DB issues related to XML DB
    XML  space for the following subspaces
    General XML  Discussion of the general XML language, standards (XSLT, XQuery, XMLSchema, etc.) and application management issues, suggestions and tips.
    PL/SQL XML Programming  PL/SQL programming using XDK and related management issues inside Oracle database server. Any question for XML DB functionality, please post your question in Products -> Database-> XML DB.
    XQuery Discussion of Oracle XQuery Technology Preview, W3C XQuery specifications, and JSR 225: XQuery API for Java (XQJ) issues
    I think I now have an idea (not that I'm sure about it) where my question will fit best. Now, because there is an explanation of the scope of the space, I don't remember something like this in the old forum. Nevertheless it might be confusing for a new member or one that lacks a certain knowledge about the subtleties:
    One step forward everyone who understands the explanation for the PL/SQL XML Programming space!
    When I have a question about XQuery, how can I decide whether XQuery is correct or General XML?
    Which questions qualify for XML DB and not for any of the others.
    We all know that many users are not able to see that SQL questions don't belong into the SQL Developer space, how can we expect that they will find the "correct" forum for XML questions? In the end they will end up in the SQL and PL/SQL space anyhow :-)
    Regards
    Marcus

    My $0.02.
    As I recall, the explanation for each forum was at the entry level for each forum and not displayed within the forum itself.
    The PL/SQL XML Programming space refers to the Oracle XML Developer Kit.  It is maintained by a different team than the XMLDB so the need for a separate space for it makes sense.  That said, what it covers is also part General XML and XQuery if you dig into what you can do in the XDK.
    Some questions that would qualify for the XML DB space.
    Anything related to schema registration or downstream of schema registration.  Such as querying/performance/indexes/etc.
    Issues parsing XML via using XMLTable (or XQuery, such as the new XQuery update added in 11.2.0.3) (Yes that can conflict)
    Storage of data in XMLType columns
    I to have always been a bit unclear on the exact division between groups in this XML space.  I see the XQuery space as being a subset of the General XML space.  I watch all three forums, as they are normally low volume and you never know where a question will pop up.  As you have seen, questions often end up in the wrong forum and often General XML gets an influx of questions that should go into the Business Intelligence space as well.  There is no good way right now to start a generic post and let the system suggest forums that the post could go into, based on content or software involved.  That would be a nice touch for the future.

  • Basic Exporting Question

    My main question is a very basic exporting question, but here is a super-condensed explanation of my big-picture goal for context:
    Large (~450 MB) aiff on CD --> trim w/ Quicktime --> small (~16 MB) MP3 in iTunes
    I would like to take an audio file (aiff) that is approximately 450 MB and export it from Quicktime and in doing so, reduce the file size and convert it to MP3. When I simply try to export it, it doesn't ask me about what size I want, nor does it give the option of MP3 formatting.
    I have figured out how to reach my goal, but it's a mess. After I make my trims in QT, I have to:
    1. select "share" instead of "export".
    2. It asks me what size I want and I select small.
    3. The file is then exported as a Quicktime movie into Mail and the size is reduced from 450 MB to about 20 MB.
    4. I then have to "right-click" on the attachment in the email that is created,
    5. save the attachment,
    6. discard the email,
    7. import the file into iTunes, and
    8. create an MP3 in iTunes to finally arrive at my goal.
    This seems like a ridiculously convoluted process to change a large aiff to a small MP3 and put it in iTunes. Any suggestions?

    Thanks. I guess the basic answer to my question is that it can't be done in one or two fell swoops. The problem is that it starts on a burned disc, and I need to make edits to it before it ends up in iTunes (to be eventually used in iWeb). I was hoping to avoid juggling back and forth between iTunes and QT. I either would have to send it back to QT to do the edits after -->iTunes-->mp3, or import the large file from the CD to QT, make the edits, save changes, import large file to iTunes, convert to mp3.

  • Basic  XML Publisher Question: How to access tags in the higher levels?

    Hi All,
    We have a basic question in XML Publisher.
    We have a xml hierarchy like below:
    <CD_CATALOG>
    <CATALOG>
    <CAT_NAME> CATALOG 1</CAT_NAME>
    <CD>
    <TITLE>TITLE1 </TITLE>
    <ARTIST>ARTIST1 </ARTIST>
    </CD>
    <CD>
    <TITLE> TITLE2</TITLE>
    <ARTIST>ARTIST2 </ARTIST>
    </CD>
    </CATALOG>
    <CATALOG>
    <CAT_NAME> CATALOG 2</CAT_NAME>
    <CD>
    <TITLE>TITLE3 </TITLE>
    <ARTIST>ARTIST3 </ARTIST>
    </CD>
    <CD>
    <TITLE> TITLE4</TITLE>
    <ARTIST>ARTIST4 </ARTIST>
    </CD>
    </CATALOG>
    </CD_CATALOG>
    We need to create a report like below:
    CATALOG_NAME     CD_TITLE     CD_ARTISTCATALOG 1     TITLE1     ARTIST1
    CATALOG 1     TITLE2     ARTIST2
    CATALOG 2     TITLE3     ARTIST3
    CATALOG 2     TITLE4     ARTIST4
    So we have to loop at the level of <CD> using for-each CD. But when we are inside this loop, we cannot access the value of CAT_NAME which is at a higher level.
    How can we solve this?
    Right now, we are using the work-around of set_variable and get_Variable. We are setting the value of CAT_NAME inside an outer loop, and using it inside the inner loop using get_variable.
    Is this the proper way to do this or are there better ways to do this? We are running into troubles when the data is inside tables.

    you can use
    <?../CAT_NAME?>copy past to your template
    <?for-each:CD?> <?../CAT_NAME?> <?TITLE?> <?ARTIST?> <?end for-each?>

  • Very basic SQL/XML question

    I'm using the following environment:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    However, I don't think my environment is the issue.
    I'm trying to get output which looks like this from a simple table:
    <MAXDOMAIN action="S">
         <DOMAINID key="true">domainid_data</DOMAINID>
         <SYNONYMDOMAIN type="relationship" action="AU" >
              <VALUE key="true">value_data</VALUE>
              <MAXVALUE>maxvalue_data</MAXVALUE>
              <DESCRIPTION>description_data</DESCRIPTION>
              <DEFAULTS>defaults_data</DEFAULTS>
         </SYNONYMDOMAIN>
    </MAXDOMAIN>The table looks like this
    Name                           Null     Type          
    DOMAINID                       NOT NULL VARCHAR2(30)   
    DESCRIPTION                             VARCHAR2(50)   
    DOMAINTYPE                              VARCHAR2(5)    
    MAXTYPE                                 VARCHAR2(5)    
    LENGTH                                  VARCHAR2(5) The real question is how do I get an element with attributes to also have content.
    <DOMAINID key="true">domainid_data</DOMAINID>and
    <VALUE key="true">value_data</VALUE>I'm not sure if I'm syntactically challenged or just not using the correct tags.
    If I try to just generate the first two tags, forgetting the following nesting, I'm OK, as long as I don't try to assign attributes to the DOMAINID tag:
    SELECT  XMLELEMENT
    ("MAXDOMAIN",XMLATTRIBUTES('S' AS "action"),XMLELEMENT(NAME DOMAINID, "DOMAINID")
    AS "RESULT"
    FROM FAC_MAXDOMAIN;This works and is pretty trivial.
    <MAXDOMAIN action="S"><DOMAINID>AIRFLOWTYPE</DOMAINID></MAXDOMAIN>
    etc, etc...However, this:
    SELECT  XMLELEMENT
    ("MAXDOMAIN",XMLATTRIBUTES('S' AS "action"),XMLELEMENT(NAME DOMAINID, "DOMAINID",XMLATTRIBUTES('true' AS "key"))
    AS "RESULT"
    FROM FAC_MAXDOMAIN;Yields an ORA-00907: missing right parenthesis error.
    Any ideas? maybe a good primer on SQL/XML might be the best solution...
    TIA,
    Paolo

    Very nice for a first post in terms of data included and formatting.
    It took me a few minutes to see it, but the simple answer is you are putting the XMLAttributes in the wrong location. See the XMLElement spec at http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions220.htm#SQLRF06168 that shows XMLAttributes comes between the identifier and value. So that means you should have written it as
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
    SQL> WITH FAC_MAXDOMAIN AS
      2  (SELECT 'domainid_data' domainid, 'dscr' description,
      3          'type' domaintype, '10' maxtype, '5' length
      4     FROM dual)
      5  -- Using WITH so didn't have to create your table locally
      6  SELECT  XMLELEMENT("MAXDOMAIN",
      7            XMLATTRIBUTES('S' AS "action"),
      8            XMLELEMENT(NAME DOMAINID, XMLATTRIBUTES('true' AS "key"), "DOMAINID")
      9          )
    10  AS "RESULT"
    11  FROM FAC_MAXDOMAIN;
    RESULT
    <MAXDOMAIN action="S"><DOMAINID key="true">domainid_data</DOMAINID></MAXDOMAIN>

  • A very basic sql xml question..

    I want to print only two rows group by grup number so there are only two group numbers
    0 and 1...
    so 0 group should have two items...
    Elapsed: 00:00:00.01
    15:15:55 SQL>
    15:15:56 SQL> l
      1  with data as
      2    (select 0 as grp,'A' item_name , 'XX' Item_desc from dual
      3     union
      4      select 0 ,'B'  , 'XY'  from dual
      5      union
      6      select 1 ,'B'  , 'Y'  from dual
      7       )
      8  select xmlelement(name "grp",
      9            xmlforest(grp  "item_name",item_name)
    10            )
    11*  from data
    15:15:57 SQL> /
    XMLELEMENT(NAME"GRP",XMLFOREST(GRP"ITEM_NAME",ITEM_NAME))
    <grp><item_name>0</item_name><ITEM_NAME>A</ITEM_NAME></grp>
    <grp><item_name>0</item_name><ITEM_NAME>B</ITEM_NAME></grp>
    <grp><item_name>1</item_name><ITEM_NAME>B</ITEM_NAME></grp>
    Elapsed: 00:00:00.01

    Hi,
    You should use XMLAGG, to get everything into a single XML element. And DON'T use extract()!!
    Something like:
    SQL> declare
       xml   xmltype;
    begin
      with data as
        (select 0 grp, 'g1' grp_name, 'A' item_name, 'XX' item_desc from dual union all
         select 0    ,  'g1' grp_name,'B'          , 'XY'           from dual union all
         select 0    ,  'g2' grp_name,'B'          , 'XY'           from dual union all
         select 0    ,  'g3' grp_name,'B'          , 'XY'           from dual union all
         select 1    ,  'g1' grp_name,'B'          , 'Y'            from dual)
    -- end of test data    
         select xmlagg(xmlelement("GRP"
                                 ,xmlagg(xmlelement("ITEM_NAME", item_name))
                                 ,xmlagg(xmlelement("item_desc", item_desc))))
           into xml
           from data
       group by grp, grp_name, item_name;
       dbms_output.put_line(dbms_lob.getlength(xml.getclobval()));
    end;
    299
    PL/SQL procedure successfully completed.Regards
    Peter

  • Access Denied error with basic XML file operations

    Hi,
    I'm trying to set up a basic read, write and delete code for XML files which I can build upon in the future. The three methods are bound to three buttons on the page and all three calls are awaited. Here's my code:
    Write:
    XElement uservarnodes = new XElement("uservars",
    new XElement("uservar1", "1"),
    new XElement("uservar2", "2"),
    new XElement("uservar3", "3"),
    new XElement("uservar4", "4"),
    new XElement("uservar5", "5"),
    new XElement("uservar6", "6"),
    new XElement("uservar7", "7"),
    new XElement("uservar8", "8"));
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.CreateFileAsync("uservarfile.xml", CreationCollisionOption.ReplaceExisting);
    var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite);
    using (var outputStream = stream.GetOutputStreamAt(0))
    DataWriter mydataWriter = new DataWriter(outputStream);
    mydataWriter.WriteString(uservarnodes.ToString());
    await mydataWriter.StoreAsync();
    await outputStream.FlushAsync();
    Read (outputs the data to a textblock):
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.GetFileAsync("uservarfile.xml");
    string readtext = await Windows.Storage.FileIO.ReadTextAsync(file);
    XElement uservarnodes = XElement.Parse(readtext);
    txtTarget.Text = uservarnodes.ToString();
    Delete:
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.GetFileAsync("uservarfile.xml");
    await file.DeleteAsync(StorageDeleteOption.PermanentDelete);
    When I tap each of the buttons once it all seems to work. But when I tap any of the buttons again within the same debug session I get an Access denied exception (E_ACCESSDENIED). Other people with this error had to await when calling their method, but I'm
    already doing that: private async void btnWrite_Click(object sender, RoutedEventArgs e) { await WriteToXMLFile(); }, etc.
    And the intervals between my taps isn't that short that you'd expect that the previously called method still had not finished completing. I don't understand why I'm getting the access denied error.
    Related to my question: I have added XML to the File Type Associations, File Open Picker and File Save Picker in the appxmanifest, but somewhere I read that you do not need to do this if you're working with local app data only. Is this true?

    var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite);
    I think because of your file stream hasn't been closed.
    by the way, it can be easier  by using System.IO.OpenStreamForWriteAsync extension method
    async public static Task<bool> SaveTextFileAsync(string filename, string data)
    byte[] fileBytes = System.Text.Encoding.UTF8.GetBytes(data);
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
    try
    using (var s = await file.OpenStreamForWriteAsync())
    s.Write(fileBytes, 0, fileBytes.Length);
    return true;
    catch
    return false;
    (need using System.IO namespace)
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • Basic XML Messaging?

    All-
    I am new to XML, so pardon this basic question. I understand
    that I can transfer xml files via http between two web servers,
    but I have a question in regards to this:
    Build XML document on Server A
    The XML document is validated against its DTD
    Server A posts the XML to Server B
    Server B receives the XML document *****HERE******
    Server B parses the document
    Server B updates a database
    Server B returns success code to Server A
    How is the *****Here****** event handled within Oracle 8i?
    Thanks,
    Megan
    null

    Sorry.
    The document's contents will be parsed and stored across a
    schema. So, the messaging is between two web servers, but the
    data received by Server B will be parsed and inserted into the
    database.
    I am basically confused about how Server B handles the posting
    of the XML document by Server A. Is there any documentation
    that I could read on this topic? Or perhaps I need to review
    XML 101.
    Thanks again,
    Megan
    The bottom line is, as I trigger requests/responses from
    Oracle XML Team wrote:
    : Can you clarify your question a bit as you prefaced it with
    : exchanging an XML document between two web servers but in your
    : example imply that the destination is a database.
    : 1. Is the document to be stored in a database?
    : 2. If so as a while or parsed and stored acrossed a schema?
    : 3. Does Server B hand it off to 8i?
    : 4. What application environment are you specifying, Java,
    : PL/SQL, C, C++, etc.?
    : Oracle XML Team
    : http://technet.oracle.com
    : Oracle Technology Network
    : Megan (guest) wrote:
    : : All-
    : : I am new to XML, so pardon this basic question. I understand
    : : that I can transfer xml files via http between two web
    : servers,
    : : but I have a question in regards to this:
    : : Build XML document on Server A
    : : The XML document is validated against its DTD
    : : Server A posts the XML to Server B
    : : Server B receives the XML document *****HERE******
    : : Server B parses the document
    : : Server B updates a database
    : : Server B returns success code to Server A
    : : How is the *****Here****** event handled within Oracle 8i?
    : : Thanks,
    : : Megan
    null

  • Basic Actionscript question

    Forgive me, I'm really new to this.
    Ok, so I'm wanting to have ads radomly play before people watch a video on my site.Is there a way to write the script for this and place it in the xml or do I have to something differently.
    I already have the video up on our site. So I'm just not sure how I "connect" the actionscript and xml that way it plays the commercial before the video.
    Do I have to build a new player and everything to do this? I've never built a player before, so if I don't have to, I'd rather not. Thanks.

    This is not a basic question but rather extensive topic.
    Yes, there are ways to connect anything to XMLs. But you have to write your own application/player that will contain the logic to do that.
    Also, there are open source player out there that may do what you ask.

Maybe you are looking for