Whitespace collapse not working on XmlValidatingReader?

Hi guys,
I need an attribute (could be an element too) to have its whitespace
collapsed [0]. I don't get the expected behavior, however.
The schema is as follows:

<xs:schema ...>
  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence />
      <xs:attribute name="Tokenize">
        <xs:simpleType>
          <xs:restriction base="xs:normalizedString">
            <xs:whiteSpace value="collapse" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>

Document is:

<Root Tokenize="On
            two lines" />

Simply code using them:

XmlDocument doc = new XmlDocument();
using ( StreamReader sr = new StreamReader( "../../TokenCollapse.xsd" ) )
{
  XmlSchema sch = XmlSchema.Read( sr, null );
  using ( StreamReader reader = new StreamReader(
"../../TokenCollapse.xml" ) )
  {
    XmlValidatingReader vr = new XmlValidatingReader( new XmlTextReader(
reader ) );
    vr.Schemas.Add( sch );
    doc.Load(vr);
  }
}

// Shouldn't contain tabs or newlines!!!!
Console.Write(doc.DocumentElement.Attributes["Tokenize"].Value);

The value is preserved and I don't get the expected behavior. Am I missing
something?

Thanks for your help.

[0] http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace

-- 
Daniel Cazzulino [MVP XML]
Clarius Consulting SA
http://weblogs.asp.net/cazzu
http://aspnet2.com



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 08/05/2004


0
kzuAT4605 (35)
5/18/2004 2:52:40 PM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
481 Views

Similar Articles

[PageSpeed] 7

Reply:

Similar Artilces:

Linked Table Manager Doesn't Work in Access 2003
I recently upgraded to Access 2003 and have found that the menu option: Tools/Database Utilities/Linked Table Manager no longer works correctly for re-linking my front end database to the backend. No tables show in the table list. If I click “Select All” and then fill in the path to the backend database I get the following error message: Method ‘List’ of object ‘IfieldListWnd’ failed. As a work around I have to delete all the table links from the front-end and then File/Get External Data/Link Tables. Is anybody else having this problem? Thanks in advance for your help. "...

yahoo intelli sync not working with Outlook XP (2002)- it was working before
I have been using Yahoo Intelli-sync (IS4Yahoo) version 4.0.100.1190 for sometime with my Outlook XP (2002) and had no problems. 2 weeks ago it stopped working and I started getting this error message: "Cannot login to Yahoo. Please check your username and password and try again." I have not changed anything in either program. I have started using Firefox but don't see any issues with that affecting the syncronisation. Any help would be appreciated. did you check your username and password? did you install any windows upgrades or firewall software? -- Diane Poremsky [MVP ...

Auto Journal not working
Hello, I'm using Outlook 2002, and would like to automatically record entires into the journal whenever I access Office XP (eg. Word, Excel etc). I've gone to the Journal Options under tools and ticked the appropriate checkboxes, however it just doesn't work. Any ideas? Pete Hi Pete, Same thing's happened to me. Have you worked it out? I wondered if it had to do with the security updates? It may have happened when I upgraded with Service Pack 2? "Pete Smith" wrote: > Hello, > > I'm using Outlook 2002, and would like to automatically > ...

.Net XmlValidatingReader should fail on complextypes with whitespace?
I believe the .Net XmlValidatingReader should fail when validating XML that contains a ComplexType element with white space when the ComplexType element has the mixed attribute set to false in the XSD used for validation. XSD fragment: <xs:element name="TRSellerBuyerData"> <xs:complexType mixed="false"> <xs:sequence> <xs:element ref="BuyerSellerReferrorFlag" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> XML fragment: <TRSellerBuyerData> </...

Webmail not working
Hi We have recently upgraded one of our exchange 5.5 sites to 2003 by adding a new server and removing the old 5.5 server. Everything works on this server apart from webmail. We have a central front end webmail server that we use to access all of our 2003 servers and this is working for all the exchanges servers apart from this new one. When you try to access the page you enter your username and password and the page goes blank and after about 60 secs or so it comes back with page cannot be displayed. If I try to directly connect to webmail on the server after entering my password I g...

Money 2007 Delux stops working when updating
I've been using Money 2007 Deluxe since its release with no problems. Suddenly last week it stops working whenever I request it to update my accounts. If I do not force an update to the accounts - it works perfectly fine and will download transactions every 24 or so hours. I've read a number of posts with people having issues when the program opens - I don't know if it's the same issue. Still, I've reinstalled the software, closed modules, changed my start page and removed online services for ING Direct (an issue in and of itself). Is there a fix out ...

Reports only work on server
Hello, We are having an issue with running reports. The reports only work when run directly from the server. I am guessing this is a permissions issue? The error is as follows: Reporting Services Error a.. An error has occurred during report processing. (rsProcessingAborted) Get Online Help a.. Cannot create a connection to data source 'CRM'. (rsErrorOpeningConnection) Get Online Help a.. Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. Any help would be greatly appreciated. Neil The most likely reason for this would be if Reporting Services was inst...

Mail merge working erratically
I use a calculated field from Excel as a mail merge in Word. We hav changed from Office 2K to office XP. From then on there is a decima overflow. If my data in excel is 0.06, the same in word is reflecte as 5.666666666666669 etc. Some one kindly help. I did not have thi problem in office 2k:confused -- Message posted from http://www.ExcelForum.com Hi krishca , If the column were text, you won't have the problem, but since it is a numeric field in Excel XP you would want to ... In the Confirm Data Source dialog box, click the MS Excel Worksheets via DDE (*.xls), and then ...

Re: spell checker not working #3
I'm currently running Outlook 2002 with Win XP. I just received a new message stating "error occurred while checking spelling" I tried to run detect and repair but with no luck. It was working previously. Any suggestions. ...

Change folder permissions no longer working
Hi I have a script that sets various folder permissions for a domain user. This has worked fine for ages without problems. The other day i installed a second domain controller into the domain. Since then i get the following error when i run this script (although it seems to be intermittent) Exception calling "SetAccessRule" with "1" argument(s): "Some or all identity references could not be translated." At C:\Provisioning\newsite.ps1:129 char:19 + $acl.SetAccessRule <<<< ($accessRule) ######?? + CategoryInfo : NotSpecif...

strip trailing whitespace
I need to strip trailing whitespace from all cells, hopefully in one simple step, rather than using the "Trim" function. Any ideas? www.asap-utilities.com (it's free and it works great) There is a nice tool you can use to do this. It's on the TEXT menu. It's called "Delete number of ending characters". it let's you specify how many characters you want to chop off the end. "indigoshift" wrote: > I need to strip trailing whitespace from all cells, hopefully in one simple > step, rather than using the "Trim" function. Any...

Collapsing Rows
I have seen spreadsheets where rows are subtotaled and the rows making up the subtotaled are hidden. In other words, rows are expanded and then the detail is closed. My question is how do I set up my spread sheet to expand and collapse? I would appreciate any help. -- ERSCPA Sort your data by some key column. Then select your range and do Data|subtotals Use at each change in that key column to count/sum/average.... for every field you want. You'll see those outlining symbols to the left. You can expand/hide by clicking on those numbers at the top or by clicking on the +/-'s f...

Does Post-callout still work after Integrated by Great Plains
I guess ICRMCallout Interface uses Publisher and Subscriber database to capture the database modification information. Is that correct ? And also I noticed that after I installed Biztalk and Great Plains, the CRM database is not set up as a publisher any more. I am not sure if ICRMCallout could still work or not after Great plains integrated Biztalk and Great Plains should not affect the CRM Replication configuration. If they did, something went wrong with your install. Post Callouts do not rely on the replication to function. They are actually part of the CRM framework and are invoked ...

follow-up flag not working
Hi, I am using Ooutlook2K with exchange 5.5. My users create subfolders within their main inbox (all within their default store). When they set a followup flag to go off on a message in a subfolder, it does not work. any ideas? Thanks, ...

Whitespace
Hi, I would like to find out whether whitespace is potentially retrievable? Our company has a mail retention policy, which we enforce across the organisation using a third party utility. However, could whitespace within the mailbox stores be retrieved and viewed? I would like to find out if anyone has had requests to sanitize this area and harden the information from being compromised at a later stage. Many thanks, Gerard Gerard - we have a policy of emptying users deleted items of items that are over 30 days. We then run standard online maintenance and online defrag and we are &quo...

work at home
would you like to work at home? if so, please check this out--http://www.procardinternational.com/index.aspx?refer=CindyC8572. ...

Code wont work
My code: Appears to run through but does not produced the expected result, only offsets from current cell. Sheets("AUDIT_TRAIL_MONTHLY").Select On Error Resume Next Range("A13:A24").Find(What:=Range("D2"), LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False).Offset(0, 1).Activate Hi, What do you expect it to do? If it finds the value it will select the cell to the right and then end. -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis th...

Convert excel files to works 8 spreadsheet
I've got a new computer with Works and have old Excel files that aren't recognized by Works for XP home. Any ideas. Hi Works should be able to open *.xls files without a problem. for a commercial converter see: www.dataviz.com "Mike" wrote: > I've got a new computer with Works and have old Excel files that aren't > recognized by Works for XP home. Any ideas. ...

HQ Options not working
Hi! When I open the HQ Configuration window, there is a list of Checkboxes for "Enabled" - "Disabled" for : - Automatically create inter-store receive inventory order - Automatically create inter-store issue inventory order and other! This window doesn't work, and when accepting changes, and open the window again, all checkboxes are clear!! And of course, those options do not work neither! I'm working by lauching inter-store trasnfers from HQ, but would like to have stores deciding this by its own. Anybody know something about this. Maybe how to set this featu...

Microsoft Money has stopped working
I have MS Money 2003 Standard. I recently bought a new laptop with Windows Vista Business and when I load Money it seems to work fine with the blank Money file installed as standard. As soon as I try to open one of my files, it tries to update the database to the current version which seems weird as it is the same disc installation I was using on my XP machine. Just after the "update" starts it gives me the "Microsoft Money has stopped working" error and tries to contact Microsoft for a reason. No reason comes back so it restarts Money. Please help as I really need ...

Is rule.dll working?
Hi, I try to use rule.dll to create an exchange rule to copy a message to another folder. My problem is when I try to add a action to rule acitons.add method of the rule component is missing. Is there a working rule dll? By the way I use c# to develope this application. MSExchange.Action objAction=new MSExchange.ActionClass(); objAction.ActionType=MSExchange.ACTION_TYPES.ACTION_COPY; MSExchange.Rules objeRules=new MSExchange.RulesClass(); MSExchange.Rule objRule=new MSExchange.RuleClass(); objRule.Actions. Here Add method is missing Thanks ...

spell check not working
My spell check in my vista program is not working on my email Define "not working". Any error message? -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "Debra" <Debra@discussions.microsoft.com> wrote in message news:E236030E-6127-43E0-959B-680F5B4D0715@microsoft.com... > My spell check in my vista program is not working on my email Always include the complete error message. If it says something like "This language is no longer available..." then do the following: =20 In the main screen of Windows Mail, (no...

working minimized
can anyone tell me if there's a way to close the outlook and have it run minimized on my notification area (area where the clock and volume control is located) instead of my taskbar. what i'm trying to do is leave my outlook running checking my email account constantly but not have it minimized on my taskbar but only have an icon on the notification area. thank you all! lukas What version of Outlook "Lukas Beltrame" <lukasob@yahoo.com> wrote in message news:072b01c3d413$97a388d0$a301280a@phx.gbl... > can anyone tell me if there's a way to close the outlo...

dialog inside tabctrl using DDX/DDV not working as expected
My testapp uses a tabctrl in a mfc dialog based application. The tabcontrol hosts multiple dialog boxes from a dialog resource. In one of the tabs, I am using an CEdit box that I would like to validate with DDX/DDV. The problem is that once I hit enter, the dialog box 'closes' and the tab gets cleared. This is because by pressing <enter> the dialog box OnOk method gets invoked which by default handles the DDX/DDV validation and then ends up closing the dialogbox. My goal is to still be able to validate the text entered into the CEdit box, but without having to go through t...

LOOKUP not working
Can anyone help me with this file. I have attached an example of what want. Thank yo Attachment filename: testexcel.xls Download attachment: http://www.excelforum.com/attachment.php?postid=57194 -- Message posted from http://www.ExcelForum.com Hi first please try to explain your issue in plain text. Don't use attachments. but in your case try the following formulas: F3: =IF(ISNA(VLOOKUP(B3,Sheet1!$B$1:$E$11,1,0)),"",VLOOKUP(B3,Sheet1!$B$1:$ E$11,1,0)) G3: =IF(ISNA(VLOOKUP(B3,Sheet1!$B$1:$E$11,2,0)),"",VLOOKUP(B3,Sheet1!$B$1:$ E$11,2,0)...