| VitalyT |
| Member |
|
|
|
|
| None Specified |
|
| Thursday, April 9, 2009 |
| Wednesday, February 2, 2011 1:41:59 PM |
11 [0.06% of all post / 0.00 posts per day] |
|
Ok, this is fine, so what should I do then? The article doesn't quite specify...
I want my attribute to allow spaces but no tabs. Is it at all achievable in XMLSpy?
Much appreciate your help with this!
|
Ok, I can see it works for an element contents, while I need to achieve the same for an attribute value, is where it fails.
|
Ok,
Another syntax and yet the same result...
When I put   XMLSpy still allows me to put tabs for such field and validation says Ok, Valid, which isn't true.
|
island wrote:Hi,
what exactly are you referring to: the regex to constrain strings in an xml schema or the regex used with the find functionality in XML Spy?
I refer to the XMLSpy implementation of Regular Expressions for XSD Schema Validation.
I created an XSD with many fields that use RegEx for validation, and a test XML to see how those RegEx field are parsed by XMLSpy RegEx. And I have problems making it understand a space-only symbol. Whatever I try (wrote above), XMLSpy accepts tab symbols as valid ones always.
|
What kind of RegEx Flavour does XMLSpy support?
I recently got stuck, unable to specify a very basic requirement - a single space-only symbol.
RegEx implementations that allow you to specify a space-only symbol include:
1. [\x20] - XMLSpy doesn't accept such syntax; 2. [ ] - XMLSpy allows both space and tab; 3. [\s-[\t]] - XMLSpy still allows both space and tab;
And XMLSpy doesn't support any of these! It is such a basic need to be able to enforce presense of a space symbol, while disallowing the tab symbol, and I can't even do such a simple thing in Altova! What's the story with your RegEx thing there?
|
Thank you, Rocco. Replacing XmlDataDocument with XmlDocument did the trick.
|
Was this issue ever followed my Altova support? What did they say or promise on this?
Also, what version of .NET were you using?
|
Even though XMLSpy 2010.3 SP1 received some treatment to work with VS2010, the part where it generates C# code wasn't really updated.
I'm seeing the same old code syntax that was there since VS2005. And it makes use of now obsolete code, which produces compilation warnings, like the one shown below...
For project AltovaXML it creates file xmldocument.cs which uses the following constructor for XmlNode class:
Code: static public XmlNode Load(string filename) { XmlDataDocument doc = new XmlDataDocument(); doc.Load(filename); return doc; }
This produces warnings during compilation: xmldocument.cs(23,4): warning CS0618: 'System.Xml.XmlDataDocument' is obsolete: 'XmlDataDocument class will be removed in a future release.'
Maybe there wasn't as much change in the XML layer from VS2005 to VS2008, but there is plenty of change with VS2010 now, and Altova team was expected to respond accordingly.
For now we have to change the code manually every time after generation, wasting our time and wondering how much performance we are losing by using the obsolete code instead of the new XML code...
Code: static public XmlNode Load(string filename) { #pragma warning disable 618 XmlDataDocument doc = new XmlDataDocument(); #pragma warning restore 618 doc.Load(filename); return doc; }
We are going to update our XMLSpy Enterprise license, but hiccups like this make it a hard decision, because we are not getting anything new in the code generation.
Please, Altova developers, step in and make it done right!
|
Ok,
After a long try an error, I found a way to make it work:
XmlProcessingInstruction ins = root.Node.OwnerDocument.CreateProcessingInstruction("xml-stylesheet", ""); ins.InnerText = "type=\"text/xsl\" href=\"LangMaster.xsl\" "; XmlNode node = root.Node.OwnerDocument.InsertBefore(ins, root.Node);
I don't know how valid this operation is, but it works for me, creating the following node: <?xml-stylesheet type="text/xsl" href="LangMaster.xsl"?>
Is there a better (more elegant) way of doing this? 'Cos this one seems a bit of hacking...
|
Thank you, island.
However, your code example produces the following instruction:
<?xml-stylesheet LangMaster.xsl?>
while I wanted precisely:
<?xml-stylesheet type="text/xsl" href="LangMaster.xsl"?>
What else do I need to do to achieve the desired results?
|
|