Thanks a lot for your wonderful too, I want to use it to create XML output file not only with Elements and Text nodes, but also with attributes.
Secondly, I want to know, how I can put some static lines in start of outputXML file e.g.
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
my apology for being very naïve in XML, would you please describe bit more about
<globalVariable name="$gv00">10</globalVariable> and you’re also using $gv01 and $gv02.
Thanks in advance
Looking forward to hear you soon
Best regards
Jibbi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) There is no way how to create attributes in current version of dbsql2xml directly, but You can create them in easy way using XSLT "postprocessing". Create XML using dbsql2xml and then apply to resulted XML your XSLT to change some Elements to Attributes.
2) The same answer is for putting some "static" text into XML. Use XSLT "postprocessing" on the resulted XML.
3) Your mentioned example from my distribution is example of pre-defined variables. $gv00 is pre-defined (fixed within template), while $gv01 and $gv01 is defined on the fly during evaluation - execution of dbsql2xml template. On the fly evaluation is used as the value of foreign key to be able to add descendant tables. Think about on the fly variables as about nested SQL stored procedure using cursors.
In fact, if You are using some up-to-date versions of advanced databases like MS SQL Server 2005 and above (sure also Oracle and so on), You can achieve the same result (but much faster and without third-party tools like dbsql2xml ;-) using SELECT ... FOR XML PATH mode on e.g. "http://msdn.microsoft.com/en-us/library/ms189885(SQL.90).aspx". You can on-the-fly create any type of nodes very easily. Because You can create XML output inside the document as text and then download it using any simple Java code, there will be limited space for dbsql2xml in the near future ;-) If You are not sure, how to do this in MS SQL Server 2005 and above, send me a message and I can send You my example of TREE XML output using just large but simple SQL SELECT, which is very similar to dbsql2xml template.
Best regards, Stepan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Happy New Year,
I’m very thankful for you comprehensive answer.
Would you please give me a bit of clue, how can I convert Elements of one XML file into Attribute of Element in output XML file in result of using XSLT and how to use XSLT with java code (my apology for naïve question again). Any help in this regard will be highly appreciated
Even though I’m using MySQL database store, I would appreciate if you send me Example Code that you mention in your third paragraph.
Cheers
Jibbirana
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sorry i almost forgot to mention that, one way of using XSLT with dbsql2xml is putting XSLT file path in these tags which you showed in xmlTreeMapping file.
sorry i almost forgot to mention that, one way of using XSLT with dbsql2xml is putting XSLT file path in these tags which you showed in xmlTreeMapping file.
sorry i almost forgot to mention that, one way of using XSLT with dbsql2xml is putting XSLT file path in these tags which you showed in xmlTreeMapping file.
Hi Stepan,
Thanks a lot for your wonderful too, I want to use it to create XML output file not only with Elements and Text nodes, but also with attributes.
Secondly, I want to know, how I can put some static lines in start of outputXML file e.g.
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
my apology for being very naïve in XML, would you please describe bit more about
<globalVariable name="$gv00">10</globalVariable> and you’re also using $gv01 and $gv02.
Thanks in advance
Looking forward to hear you soon
Best regards
Jibbi
Hi, Jibbi!
1) There is no way how to create attributes in current version of dbsql2xml directly, but You can create them in easy way using XSLT "postprocessing". Create XML using dbsql2xml and then apply to resulted XML your XSLT to change some Elements to Attributes.
2) The same answer is for putting some "static" text into XML. Use XSLT "postprocessing" on the resulted XML.
3) Your mentioned example from my distribution is example of pre-defined variables. $gv00 is pre-defined (fixed within template), while $gv01 and $gv01 is defined on the fly during evaluation - execution of dbsql2xml template. On the fly evaluation is used as the value of foreign key to be able to add descendant tables. Think about on the fly variables as about nested SQL stored procedure using cursors.
In fact, if You are using some up-to-date versions of advanced databases like MS SQL Server 2005 and above (sure also Oracle and so on), You can achieve the same result (but much faster and without third-party tools like dbsql2xml ;-) using SELECT ... FOR XML PATH mode on e.g. "http://msdn.microsoft.com/en-us/library/ms189885(SQL.90).aspx". You can on-the-fly create any type of nodes very easily. Because You can create XML output inside the document as text and then download it using any simple Java code, there will be limited space for dbsql2xml in the near future ;-) If You are not sure, how to do this in MS SQL Server 2005 and above, send me a message and I can send You my example of TREE XML output using just large but simple SQL SELECT, which is very similar to dbsql2xml template.
Best regards, Stepan
Hi Stepan,
Happy New Year,
I’m very thankful for you comprehensive answer.
Would you please give me a bit of clue, how can I convert Elements of one XML file into Attribute of Element in output XML file in result of using XSLT and how to use XSLT with java code (my apology for naïve question again). Any help in this regard will be highly appreciated
Even though I’m using MySQL database store, I would appreciate if you send me Example Code that you mention in your third paragraph.
Cheers
Jibbirana
sorry i almost forgot to mention that, one way of using XSLT with dbsql2xml is putting XSLT file path in these tags which you showed in xmlTreeMapping file.
<processingInstructions>
<!--<css>css/dbsql2xml.css</css>-->
<!--<xslt>xslt/dbsql2xml.xsl</xslt>-->
</processingInstructions>
is that right approach?
sorry i almost forgot to mention that, one way of using XSLT with dbsql2xml is putting XSLT file path in these tags which you showed in xmlTreeMapping file.
<processingInstructions>
<!--<css>css/dbsql2xml.css</css>-->
<!--<xslt>xslt/dbsql2xml.xsl</xslt>-->
</processingInstructions>
is that right approach?
sorry i almost forgot to mention that, one way of using XSLT with dbsql2xml is putting XSLT file path in these tags which you showed in xmlTreeMapping file.
<processingInstructions>
<!--<css>css/dbsql2xml.css</css>-->
<!--<xslt>xslt/dbsql2xml.xsl</xslt>-->
</processingInstructions>
is that right approach?