Thursday, May 13, 2004 - Posts
Taken out today: Julie, maybe you just need to explain it
to me.
# of referenced posts by category: Development: 4; Other: 1;
Line of the day: There was much deliberation on this topic and
we concluded that we were satisfying the transformation scenarios our customers
had, but were failing on the core query scenarios. Given that we don't
have infinite resources, we felt that having a strong XPath 1.0, XSLT
1.0, and XQuery 1.0 implementation was more important than having a
mediocre XPath 1.0/2.0, XSLT 1.0/2.0, XQuery 1.0 story.
Post of the day:
XSLT 2.0 Sir?
Remember: the Take Outs FAQ is at:
http://sqljunkies.com/WebLog/ktegels/articles/1387.aspx
I wish I would have realized this before sending somebody down a rabbit path. From “Troubleshoot XML import and export errors.”
- An XML mapping cannot be exported if the mapped element’s relationship with other elements cannot be preserved. This relationship may not be preserved for the following reasons:
- The schema definition of a mapped element is contained within a sequence with the following attributes:
- The maxoccurs attribute is not equal to 1.
- The sequence has more than one direct child element defined, or has another compositor as a direct child.
The schema we want to use encapsulate a parent-child relationship like this:
<person>
<name given family other />
<addresses>
<address type street locale region postal />
<address type street locale region postal />
</addresses>
<person>
Where our schema says that <address> is MaxOccurs unbounded per addresses.
I'm currently thinking that would could resolve this with a little bit of code and VSTO. Otherwise, I'm pretty sure we can resolve it exporting to CSV and building our XML from that.
Still, does anybody have workarounds for this? Is this mapping something we can look forward to being resolved in a future version of Excel?
BTW, I'm not really blogging in black because I'm lazy. Its my fashion statement -- Black is the new pink, you know. (grin)
Dearth: A scarce supply; a lack
InfoDearth: A scarce supply of information about something; a lack of documentation
I just want to do something simple. I have worksheet that some users want to treat like a database. They also want to have the data rendered in an classic ASP page. Path of least resistence for me: I want to export said worksheet to XML conforming to a specific schema and then apply an XSLT to it. So, I created a VSTO project based on said Workbook. Cool, there's an event that I can hook into that should let me write the XML to a custom format -- BeforeXMLExport. So, whats the formal parameter list for this, I wonder. F1 into MSDN library. No matches. Anything on Google? One hit. One. Ouch. Google Groups has nothing either. Great googly-moogily!
I'm thinking I'm going to hate saying this, but using classic ADO and Excel's data provider might be the path of very-least-resistence here.
Anybody got some documentation on this event -- or even better (IMHO) an example?
Update: Got some excellent help from Stephen Bullen on this. Boils down to that BeforeXMLExport isn't what I thought it was (but it does -- kind of -- what I thought it did) and that the VS.NET pull down will generate the signature for you. Doh! That's what I get for learning .NET with TextPad.
I found out that schema is too complex for Excel to deal with, though. Rant about that in the works.