Trying to parse OpenDocument files (sxw)

Iam trying to read in sxw files and generate a preview for it.
The problem now is that the file "content.xml" seem to contain a DTD.
I do not want to process this DTD because this is a separate file which 
is not available at this time.

I tried everything, but no matter what I do I get errors that the DTD is 
not found or cannot be accessed due to security reasons.

Can't I deactivate usage of the DTD?

XmlReaderSettings s = new XmlReaderSettings();
s.IgnoreComments = true;
s.IgnoreWhitespace = true;
s.IgnoreProcessingInstructions = true;
s.ValidationType = ValidationType.None;
s.ProhibitDtd = true;
s.ValidationFlags = XmlSchemaValidationFlags.None;

using (XmlReader reader = XmlReader.Create(stream, s))
{
          while (reader.Read())
          {
               if (reader.NodeType == XmlNodeType.Text)
                     text.Append(reader.Value);
          }
}
0
deutronium (13)
8/11/2008 7:20:52 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
866 Views

Similar Articles

[PageSpeed] 48

cody wrote:
> Iam trying to read in sxw files and generate a preview for it.
> The problem now is that the file "content.xml" seem to contain a DTD.
> I do not want to process this DTD because this is a separate file which 
> is not available at this time.
> 
> I tried everything, but no matter what I do I get errors that the DTD is 
> not found or cannot be accessed due to security reasons.
> 
> Can't I deactivate usage of the DTD?
> 
> XmlReaderSettings s = new XmlReaderSettings();
> s.IgnoreComments = true;
> s.IgnoreWhitespace = true;
> s.IgnoreProcessingInstructions = true;
> s.ValidationType = ValidationType.None;
> s.ProhibitDtd = true;
> s.ValidationFlags = XmlSchemaValidationFlags.None;
> 
> using (XmlReader reader = XmlReader.Create(stream, s))
> {
>          while (reader.Read())
>          {
>               if (reader.NodeType == XmlNodeType.Text)
>                     text.Append(reader.Value);
>          }
> }

Sorry for bothering you, it now works. I just had to set XmlResolver to 
null :)
0
deutronium (13)
8/11/2008 7:24:22 PM
Reply:

Similar Artilces:

How to change default 'Files of Type' to open only .pub files
Is there a setting in the registry or elsewhere so that when I File-Open I only get .pub files & not have it default to Files of Type "All Publisher Files"? It takes a long time for it to find all the files with various extensions. PUB files are all I want. -- T.G. Lambini Create a folder in My Documents, name it Publisher or whatever, Open options in Publisher, general tab, click the publication line, click modify... browse to the folder where you want Publisher documents to go. Drag all your Publisher documents to this folder. -- Mary Sauer MSFT MVP http://office.mi...

trying this out
This is a test posting. On Tue, 13 Nov 2007 16:06:51 +0800, "hmmmm" <bobo123@dotdot.dyndns.org> wrote: >This is a test posting. > Please use microsoft.public.test or microsoft.public.test.here for your testing. This is a working newsgroup. If you have questions about an Access database, please post them. John W. Vinson [MVP] ...

I am trying to round up to the nearest 25 cents
I am trying to round a money value to the nearsest 25 cents and it keeps rounding to the nearest dollar HELP Try =CEILING(A1, 0.25) In article <2DB8F007-1E27-4A48-923B-C7D4D0238B5E@microsoft.com>, sypher <sypher@discussions.microsoft.com> wrote: > I am trying to round a money value to the nearsest 25 cents and it keeps > rounding to the nearest dollar HELP =ROUND(A1*4,0)/4 -- HTH Bob Phillips "sypher" <sypher@discussions.microsoft.com> wrote in message news:2DB8F007-1E27-4A48-923B-C7D4D0238B5E@microsoft.com... > I am trying to round a mone...

saving pub file as .htm or .html
I just reformatted my hard drive and re-loaded Office 2003. Previously before uploading to my host server I saved my file as htm or html file--now there doesnt seem to be that option in the "save as type" file...am I missing something, do I need to install an update or an extra or did I reload the wrong version of Office/Publisher? (I thought I had 2003 previously) thanks in advance Select File, Save as a website. -- Don - Publisher 2000� Vancouver, USA "segsig" <segsig@discussions.microsoft.com> wrote in message news:32A9EBC2-2AE6-4529-9E21-83E71789C37E@m...

Trying to clear up Received but not invoiced report
I am trying to clean up the received not invoiced items. The problem began with entering a purchase order and then not matching the invoice to the items received agaisnt the purchase order. SO we thought that doing a returned transaction entery would solve the problem. The only thing is now the return shows up on our Received/ Not invoiced report. And the report is becoming a huge mess and difficult to use. What is the best way to clear up items that have been received but were not matched and already paid through the invoice entery? There is a knowledgebase article on this very thing av...

How do I... On opening file from hard disk, open a form
Hello, Microsoft Access 2003. I would like my Main Menu form to open when a user opens my database. So far I am in no way networked or web based, I'll probably get there but right now I have a file (Inventoryv4.mdb) that resides on the user's hard drive. when she opens this file, I would like my main menu form to open, instead of her having to go through the little task pane and dbl clk on frm_MAINMENU. How might one do this? ***Note: I need the task pane with all the tables queries, forms etc to still be there, just in the background, preferably minimized, and the main men...

send/receive (2nd try)
New computer. Microsoft XP Home. Microsoft Office XP Small Business 2002. Earthlink dial-up account. Two e- mail accounts. After opening Outlook, 1st send/receive (option 3, all accounts) usually prompts for both passwords, downloads messages, all good. Next time, though, no prompt for account 2, error cannot connect to server, account 1 usually gets messages. Every five minute send/receive option eventually degenerates to cannot connect to server errors for both accounts. Meanwhile internet browsing slows to a crawl. Any ideas? ...

old files seen with new version?
I need to know if i have money 99 in french-canada, does my files will be recognised with a version more recent of money (french-Canada, like 2003 or 2004)? They should be but I'm very hesitant to give you answer as localized versions of Money **never** cross to other locales and I don't know much about Canadian vs. French Canadian versions. <anonymous@discussions.microsoft.com> wrote in message news:1daf01c445bf$5c699570$3a01280a@phx.gbl... > I need to know if i have money 99 in french-canada, does > my files will be recognised with a version more recent of > money ...

How do I cancel a msg Outlook keeps trying to send unsuccessfully?
How do I cancel an "in process" email Outlook keeps trying to send unsuccessfully due to a huge email message I tried to send with way too many attachments? It's stuck in "send" mode, and as a result, I can't send any emails because Outlook cannot get past trying to send this message. How do I cancel a pending outbox transmission while it's trying to send? I've tried everything I can think of to no avail. Please help! Angelczech wrote on Fri, 12 March 2010 07:32 > How do I cancel an "in process" email Outlook keeps trying to send ...

trying to insert a 0 in front of zipcode
Hello, I do not use excel at all so i have no clue! I have a list of daycares that i want to create mailing labels with...about 700 of them but the problem is my zipcode column there needs to be a zero in front of all 700 zipcodes how to i insert a zero in front of them without having to type it into each box? the other question is can i print labels directly from excel or do i have to go thru ms word? thanks Greg One of these 1) format the cells with custom format 00000 2) format the cells with Special / Zip Codes 3) format the cells as Text 4) begin all zip codes with an sin...

File Save in network
My application has Open,Save,SaveAs menu for its configuration file. Generally configuration files are created in network server so that they can be shared and I have trouble in saving an existing file to network server. I mean, it can create and save as a new file but if I open an existing file and try to save, then I got warning msg like "Access to \\server\folder1\folder2\conf.bin was denied"(I have permission to write to the folder). Do you think this is an application problem? Just for test, I tried saving in local folder and it works. // // Open // void CMyApp::OnFileOpen() { ...

error message when trying to install WMP 10 or 11
My operating system is Windows XP Home Edition 2002. I'm trying to download either WMP 10 or 11 and I get a message saying it was not possible to complete setup, see webhelp for more assistance, however there is no additional information when I click Web help. the Error message is 8007F0DA. Can anyone help me? Thanks. On Tue, 30 Mar 2010 07:54:01 -0700, Nate <Nate@discussions.microsoft.com> wrote: > >My operating system is Windows XP Home Edition 2002. I'm trying to download >either WMP 10 or 11 and I get a message saying it was not possible to &g...

Memory leakage and exceptions to file
Hi all, I need to save all memory leakages and exception to a text/log file so that when ever error occurs I can send that log to the server or email it to the support team. Please let me know how do i catch the memory leakages. Thanks Anup Duh...That was simple enough Thanks <anup.kataria@gmail.com> wrote in message news:1159182410.281714.262220@m7g2000cwm.googlegroups.com... > Hi all, > > I need to save all memory leakages and exception to a text/log file so > that when ever error occurs I can send that log to the server or email > it to the support team. > &g...

Outlook 2003 wants to rename attached .jpg files
Whenever I attempt to save an attached .jpg file in Outlook 2003 - in "Windows Picture and Fax Viewer", the file name is changed to "New Image", so I have to highlight it and type in the correct file name. How do I deal with this "feature"? ...

error message when trying to delete messages in inbox
I cannot delete messages in my email inbox. When attempting to delete messages, Outlook says "The messaging interface has returned an unknown error. If the problem persists, restart Outlook. I continue to get the message even though I restarted Outlook. My mail works fine, but I just cannot delete anything. Does someone know a solution? Can you delete them if you hold shift as you delete? How many items are in the deleted items folder? Are you using any type of AV scanner on the message store? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coa...

Opening file when file name is always different
Using Excel 97 on WINNT Each fortnight I receive a report which is then formatted and save using a dated filename for the next Wednesday e.g. "570 Repor 28-07-2004". Next period, this report will be automatically saved as 570 Repor 11-08-2004". I use the code: "G:\ER\570 report " & Format(date+4-weekday(date), "dd-mm-yyyy") ".xls" which was kindly supplied by Dave Peterson. I am now trying to compare fortnightly reports and was wondering i there is a way to call the current report and the previous fortnightl report using VBA as part of a mac...

how to zip a file from VBA
Hi, I would like to write a code that will zip a file. I would like to be able to specify the source file (e.g. Data.txt) and specify the name of the zip file (e.g. Data.zip). How can I do this? I am using access 2007. thanks! http://www.databasejournal.com/features/msaccess/article.php/3835766/Working-with-Compressed-zipped-folders-in-MS-Access.htm -- Doug Steele, Microsoft Access MVP http://www.AccessMVP.com/DJSteele (no e-mails, please!) "Boon" <boonyawat.la-ongthong@cnh.com> wrote in message news:eXdcLuyqKHA.3536@TK2MSFTNGP06.phx.gbl... >...

Try or TRY
Hello, Will there be any opitmization or ... when we use INT or TRY macros instead of int or try ? Which one is better to be used? Thanks, JSmith "JSmith" <jsmithmitra@yahoo.com> wrote in message news:%23G1sOVdoEHA.692@TK2MSFTNGP12.phx.gbl... > > Hello, > > Will there be any opitmization or ... when we use INT or TRY macros instead > of int or try ? Which one is better to be used? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_exceptions.3a_.converting_from_mfc_exception_macros.asp -- Jeff Partch [VC++ MVP] FYI, TRY ...

Database file size
I just looked at the properties screen for our main database and saw it was at 90% capacity. Not sure what would happen if it got to 100%, but probably should do something? What's best to do...delete old journals, inactive items and suppliers. How do I delete transaction history? Does it get archived? Thanks! You're getting ahead of yourself.. It will always be at 90% capacity (with 10% growth space) as it grows. The overall file size is what you need to be concerned with. You may want to research how SQL databases grow (autogrow) to fully understand what that 90% / 10%...

Problem trying to export e-mail messages
When I go into Windows Mail and export my messages, the export completes but then I go and the folders don't match my existing e-mail folders. There are folders showing which I had deleted months ago. Could it be a corrupt file? How can I just transfer the e-mail messages I need to a new PC with Windows 7? Thanks> Windows Mail uses internal mail folder names that may not correspond exactly to the folder name in the user interface. What are you doing with your Windows Mail messages in Windows 7? Windows Mail was not designed to run on Windows 7. --=20 Gary VanderMole...

try/catch vs TRY/CATCH
Hi, What is in your opinion the preferred way of doing exception handling for MFC objects (such as the CFile)... the try/catch mechanism or the MFC based TRY/CATCH macros? Thanks Adeel Use try/catch. I don't recall what TRY/CATCH does but, basically, that was provided before VC++ had full support fro try/catch. -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "Adeel" <dontWantSpam@All> wrote in message news:ORLqQz3fGHA.4568@TK2MSFTNGP03.phx.gbl... > Hi, > > What is in your opinion the preferred way of doing exception handling for ...

Trying to finish up a worksheet function (if/or??)
Okay, here are the details and the exact data: A12 thru A17 = Income Source (text, user defined [examples would be Social Security, Pension, etc.]) B12 thru B17 = Amount Received (will be currency in $dddd.cc format) C12 thru C17 = Tax Deductible? (currenty have a drop-down list option, YES or NO) A18 = Subtotal (text) B18 = Subtotal (calculated sum of above columns) C18= [empty] A20 = Choose an Investor (text) B20 = Investor name (from drop down list) C20 = Mark up amount (i.e., 125%, would like it to auto fill from the investor chosen) A22 = Total (text) B22 = Total (calculated su...

Can not Read Excel files
Hi, I am writing for my boss having trouble. She has a relatively new computer, Windows XP, and has Quattro Pro installed. However, she is working on group projects with people who have Excel and she can not read any of their files. I suggested the free viewer download from Microsoft but it doesn't seem to be supported by Windows XP. Any ideas? Thanks!! It is supported and works well "Elizabeth" <anonymous@discussions.microsoft.com> wrote in message news:352f01c4293e$94c90650$a501280a@phx.gbl... : Hi, I am writing for my boss having trouble. She has a : relatively...

Outlook 2003 Follow Up Flag File Failure
Hi: I’m running Outlook 2003, Win XP-Pro with all SPs and the latest updates, but have recently developed a problem with Outlook’s Follow Up flag feature. I’m able to flag messages in my Inbox with one of several different colors; but none of the flagged messages automatically appear in the built-in Follow Up folder. Sure, I can still drag and drop copies of flagged messages into the Follow Up folder, but I miss the auto feature – something that has worked up until recently. I did a “repair” to Outlook, but the problem still exists. All my e-mail accounts are POP-3 accounts...

Run Time error when trying to use DMax on a line value
Please can someone help me with run time error I am getting when I try to use a DMax function on a LineID control in a subform. I have a main form frmDeliveries and a subform sfrmDeliveryDetails They are linked on master and child by a DeliveryID control. On the sfrmDeliveryDetails BeforeUpdate I entered : Private Sub Form_BeforeInsert(Cancel As Integer) Me![LineID] = Nz(DMax("[LineID]", "[sfrmDeliveryDetails]"), 0) + 1 End Sub (which I modified from a previous posting) When I try to enter a selection from a Productscombo on the sfrmDeliveriesDetails I get a Run Ti...