Archive for the ‘XML’ Category
Posted by jpluimers on 2011/07/28
When you generate Excel XML Spreadsheets, and you load it in Excel, it will report some errors in your Temporary Internet Files directory.
For instance, when you forget to fill the Data.Type attribute, then you get a log file with a message like this:
XML ERROR in Table
REASON: Missing Tag
FILE: V:\export.xml
GROUP: Cell
TAG: Data
ATTRIB: Type
Note that some errors won’t be reported. For instance if you forget to put your Data in a Cell.Data (and put it in Cell); then Excel just show empty worksheet.
There seems to be no XSD for the XML Spreadsheet format, so you have to get yourself familiar with the XML in Excel and the Spreadsheet Component documentation on MSDN.
You can view where to put your stuff in the XML Spreadsheet Tag Hierarchy. That list doesn’t have individual links to the tags, you need the XML Spreadsheet Reference for that.
To make things more practical for myself, I perfomed these steps:
- created a spreadsheet with all of the data variations I expected
- saved this spreadsheet as XML
- generated the XSD from that XML
- imported the XSD to generate wrapper classes and interfaces
Even with that, you will need to accommodate for many peculiarities.
Hopefully I will find some time to write more those down soon.
The first is ss:Data:
- It contains the actual data of a cell
- It has a required ss:Type attribute, which is an enumeration of Number, DateTime, Boolean, String, and Error.
- When it is String, then x:Ticked should be 1 (meaning True) when the string can be parsed as non-String type (and you would type the value into excel starting with a Tick mark (‘ aka single quote or apostrophe)
–jeroen
Posted in .NET, Development, Software Development, XML, XML/XSD, XSD | 3 Comments »
Posted by jpluimers on 2011/02/09
Quite a while ago, user bobince wrote great answer on why not to parse html with RegEx.
Somehow people fail to recognize the brilliance of the answer, and try to simplify it into something like “don’t, use an XML or HTML parser in stead”.
bobince even posted some nice contra-examples that are impossible to parse in RegEx (heck, even most regular HTML and XML parsers have difficulties with them).
So: enjoy the beauty of the answer while it is still locked for editing.
–jeroen
Posted in Development, HTML, RegEx, Software Development, Web Development, XML, XML/XSD | 2 Comments »
Posted by jpluimers on 2011/01/18
In the past I wrote a few blog posts on posting sourcecode in WordPress.
Nick Hodges‘ last Flotsam and Jetsam blog post pointed me to the SyntaxHighlighter JavaScript that is used by WordPress and many other engines/sites.
Their site contains an even more elaborate list of supported languages.
I had the basic list right in my last post, but was missing all the aliases (which often are easier than the longer proper names).
This is the new table adapted from their list: Read the rest of this entry »
Posted in .NET, Batch-Files, C#, CSS, Database Development, Delphi, Delphi for PHP, Development, HTML, HTML5, Java, PowerShell, RegEx, Scripting, SQL, VBS, Web Development, WordPress, XML, XML/XSD, XSD | 5 Comments »
Posted by jpluimers on 2010/11/23
Quite a while ago, I wrote about the XSD.EXE tool to generate wrapper classes from an XSD file.
Recently, I had to create an XSD based on some XML.
Actually: a client was implementing a tool, that could export some of the data as XML.
That XML had to go into their database.
But the tool vendor told the client that the underlying XSD was ‘not supported’ (odd: why allow exporting XML and then not provide something supporting as the XSD?).
Anyway, the data was not that difficult, but having an XSD at hand made the import process a lot easier.
So lets see how to get a starting XSD from an of XML files (in practice, you would do this with a couple of XML files, then collect the best pieces into your final XSD). Read the rest of this entry »
Posted in .NET, Delphi, Development, Software Development, XML, XML/XSD, XSD | 11 Comments »
Posted by jpluimers on 2010/11/03
I tried searching for an XSD or other schema that describes ASX (Advanced Stream Redirector) files, but somehow could not find them.
The ASX files can be used to generate a playlist, but they are a bit richer in content than the WPL (Windows Media Player Playlist) file format.
So here is a post with some references to ASX files, examples, documentation and an XSD you could use for ASX files, and why ASX is not valid XML, it is just well-formed. Read the rest of this entry »
Posted in .NET, C#, Delphi, Development, Software Development, XML, XML/XSD, XSD | 2 Comments »
Posted by jpluimers on 2010/10/26
When on the road without access to your most favourite XML editing tools, and you want to view a local XML file, you are a bit stuck.
The built-in XML viewing capabilities of Internet Explorer 6 and up give you those nice “To help protect your security, Internet Explorer has restricted this…” messages.
Disabling those messages makes your system a lot less secure, so that is not a real option.
This besides the lack for viewing UTF-16 encoded XML files in Internet Explorer (and getting the dreaded “Switch from current encoding to specified encoding not supported. Line 1, Position 40“).
So, in my toolbox is XML Viewer from MindFusion. Read the rest of this entry »
Posted in Development, Power User, XML, XML/XSD | 3 Comments »
Posted by jpluimers on 2010/02/15
I just found out that the sourcecode tag in WordPress now supports even more languages.
This is the list of languages is below, it contains links to Wikipedia for each language.
Starred ones (bold and hyperlinks in this theme are the same ) are new since my post last year.
This is a follow up on the original article Including formatted sourcecode in WordPress « The Wiert Corner – Jeroen Pluimers’ irregular stream of Wiert stuff.
–jeroen
Posted in .NET, C#, CSS, Database Development, Delphi, Development, Encoding, Java, Software Development, SQL Server, Web Development, WordPress, XML, XML/XSD | Tagged: sourcecode language | 2 Comments »
Posted by jpluimers on 2010/01/19
Recently, I had an issue while validating XML with XSD: validation in .NET using the built in classes in the System.XML namespace, and validation in native Windows using the COM objects exposed by MSXML version 6 (which incidentally ships with the .NET 3.0 framework).
Some documents validating OK in .NET did not validate well with MSXML.
I’ll show my findings below, and try to explain the difference I found, together with my conclusions.
The main conclusion is that MSXML version 6 has a bug, but I wonder why I can’t find much more information on it.
Since there is not so much ready to use for validating XML by XSD in .NET and native, I’ll include complete source code of command-line validations applications for both platforms.
.NET source code is in C#.
Native source code is in Delphi.
Read the rest of this entry »
Posted in .NET, C#, C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools, XML, XML/XSD, XSD | 4 Comments »
Posted by jpluimers on 2009/09/13
Embarcadero has made available the replays of the CodeRage 4 sessions.
You can find them in the CodeRage 4 sessions overview.
In order to download them from that overview, NOTE: To access this session replay, you must be logged into EDN. you can login or sign-up (which is free).
To make it easier to find all the relevant downloads, below is an overview of my sessions and their links.
Let me know what you use it for, I’m always interested!
Update 20090918: changed the download locations because CodeCentral messed up.
Read the rest of this entry »
Posted in .NET, ASCII, C#, C# 2.0, CodeRage, CommandLine, Conferences, CP437/OEM 437/PC-8, Database Development, Debugging, Delphi, Development, Encoding, Event, Firebird, InterBase, ISO-8859, ISO8859, Java, Prism, Software Development, Unicode, UTF-8, UTF8, Visual Studio and tools, XML, XML/XSD, XSD | 4 Comments »
Posted by jpluimers on 2009/09/11
Not only can you watch the video and download the CodeRage 4 session on materials on Using Unicode and Other Encodings in your Programs, but below you can also find the chat transcripts below.
VIP Room Transcript with Q&A
(9/11/2009 9:09:19 AM) The topic is: Session Room 2 – “Using Unicode and Other Encodings in your Programs” by Jeroen Pluimers
Public Room Transcript
(5:52:14 PM) Christine_Ellis has set the topic to: Session Room 2 – “Using Unicode and Other Encodings in your Programs” by Jeroen Pluimers
(9/11/2009 9:12:47 AM) Jeroen_Pluimers: I got a bunch of 406 error messages in the jibber chat client, so I was afraid it lost the connection :-)
(9/11/2009 9:15:45 AM) Jim_Ferguson: Jeroen, Have you been getting a bunch of internal errors when you get fancy with generics?
(9/11/2009 9:15:53 AM) Borland: BTW, DavidI, excellent internet radio choice of KPIG. Very good Blues.
(9/11/2009 9:36:43 AM) Mandy_Walker: http://etncaweb04.embarcadero.com/resources/technical_papers/Delphi-and-Unicode_Marco-Cantu.pdf
(9/11/2009 9:39:14 AM) Jim_Ferguson: Strings are getting fatter on the back end.
(9/11/2009 9:40:39 AM) Mandy_Walker: Sorry, for incorrect link from slide. Better http://etnaweb04.embarcadero.com/resources/technical_papers/
(9/11/2009 9:49:20 AM) Jim_Ferguson: TBYtes and pChar arent equivalt. TBytes is a dynamic array. Shouln’t be pByte instead of TBytes?
(9/11/2009 9:53:05 AM) Jim_Ferguson: Sounds like Intel needs to build Unicode into the processor. There is a lot of out board thinking when it comes to characters now.
(9/11/2009 9:57:19 AM) Mandy_Walker: http://it-republik.de/konferenzen/delphi_live/material/DelpiLive09_Cantu_Unicode.pdf
(9/11/2009 9:58:26 AM) Borland: Thanks Joroen, this was packed with great information sources.
(9/11/2009 9:59:09 AM) Jeroen_Pluimers: http://en.wordpress.com/tag/coderage/
(9/11/2009 9:59:17 AM) Jeroen_Pluimers: https://wiert.wordpress.com/2009/09/09/coderage-4-session-materials-available-for-download/
(9/11/2009 9:59:24 AM) Mandy_Walker: Thx, Jeroen
(9/11/2009 10:00:47 AM) Erwin_Mouthaan: Bedankt Jeroen. Leuke presentatie!
(9/11/2009 10:01:04 AM) jthurman: Jeroen is a marching band guy?
(9/11/2009 10:01:05 AM) M_L: Thanks!
(9/11/2009 10:01:21 AM) Jeroen_Pluimers: http://www.wmc.nl
(9/11/2009 10:01:22 AM) Giel: Bedankt Jeroen!
(9/11/2009 10:01:32 AM) Robert_D_Smith: I played snare and bass drum, Jeroen
(9/11/2009 10:01:40 AM) jthurman: Jeroen: I teach high school marching band in the USA. We should talk sometime.
(9/11/2009 10:02:05 AM) Jeroen_Pluimers: write me an email: jeroen@pluimers.com
(9/11/2009 10:02:09 AM) jthurman: Will do
(9/11/2009 10:02:45 AM) Robert_Evans: Thanks Jeroen. Great stuff!
(9/11/2009 10:03:11 AM) Jeroen_Pluimers: you are welcome; let me know when you have questions or run into things that I might be able to help with
(9/11/2009 10:04:48 AM) Jeroen_Pluimers: talking about migration projects: we have done quite a few for clients; so if you need help with that as well, drop me an email
(9/11/2009 10:05:46 AM) Christine_Ellis has set the topic to: Session Room 2 – “New Features in the RAD Studio IDE” by Mark Duncan & Darren Kosinski
–jeroen
Posted in .NET, C#, CommandLine, Delphi, Development, Encoding, ISO-8859, ISO8859, Prism, Software Development, Unicode, UTF-8, UTF8, XML, XML/XSD, XSD | 1 Comment »