Search Results

Search found 4 results on 1 pages for 'monomachus'.

Page 1/1 | 1 

  • How to recursively delete some xml elements using XSLT

    - by Monomachus
    Hi, So I got this situation which sucks. I have an XML like this <table border="1" cols="200 100pt 200"> <tr> <td>isbn</td> <td>title</td> <td>price</td> </tr> <tr> <td /> <td /> <td> <span type="champsimple" id="9b297fb5-d12b-46b1-8899-487a2df0104e" categorieid="a1c70692-0427-425b-983c-1a08b6585364" champcoderef="01f12b93-b4c5-401b-9da1-c9385d77e43f"> [prénom] </span> <span type="champsimple" id="e103a6a5-d1be-4c34-8a54-d234179fb4ea" categorieid="a1c70692-0427-425b-983c-1a08b6585364" champcoderef="01f12b93-b4c5-401b-9da1-c9385d77e43f">[nom]</span> <span></span> </td> </tr> <tr></tr> <tr> <td></td> <td>Phill It in</td> </tr> <tr> <table id="cas1"> <tr> <td ></td> <td >foo</td> </tr> <tr> <td >bar</td> <td >boo</td> </tr> </table> </tr> <tr> <table id="cas2"> <tr> <td ></td> <td >foo</td> </tr> <tr> <td ></td> <td >boo</td> </tr> </table> </tr> <tr> <table id="cas3"> <tr> <td >bar</td> <td ></td> </tr> <tr> <td >foo</td> <td >boo</td> </tr> </table> </tr> <tr> <table id="cas4"> <tr> <td /> <td /> </tr> <tr> <td>foo</td> <td>boo</td> </tr> </table> </tr> <table id="cas4"> <tr> <td /> <td /> </tr> <tr> <td>foo</td> <td>boo</td> </tr> </table> <tr> <td /> <td /> </tr> </table> Now the question is how would I recursively delete all empty td, tr and table elements? Now I use this XSLT <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*" /> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="td[not(node())]" /> <xsl:template match="tr[not(node())]" /> <xsl:template match="table[not(node())]" /> </xsl:stylesheet> But it doesn't do very well. After I delete td, a tr becomes empty but it doesn't handle that. Too bad. See the table element with "cas4". <table border="1" cols="200 100pt 200"> <tr> <td>isbn</td> <td>title</td> <td>price</td> </tr> <tr> <td> <span type="champsimple" id="9b297fb5-d12b-46b1-8899-487a2df0104e" categorieid="a1c70692-0427-425b-983c-1a08b6585364" champcoderef="01f12b93-b4c5-401b-9da1-c9385d77e43f"> [prénom] </span> <span type="champsimple" id="e103a6a5-d1be-4c34-8a54-d234179fb4ea" categorieid="a1c70692-0427-425b-983c-1a08b6585364" champcoderef="01f12b93-b4c5-401b-9da1-c9385d77e43f">[nom]</span> <span /> </td> </tr> <tr> <td>Phill It in</td> </tr> <tr> <table id="cas1"> <tr> <td>foo</td> </tr> <tr> <td>bar</td> <td>boo</td> </tr> </table> </tr> <tr> <table id="cas2"> <tr> <td>foo</td> </tr> <tr> <td>boo</td> </tr> </table> </tr> <tr> <table id="cas3"> <tr> <td>bar</td> </tr> <tr> <td>foo</td> <td>boo</td> </tr> </table> </tr> <tr> <table id="cas4"> <tr /> <tr> <td>foo</td> <td>boo</td> </tr> </table> </tr> <table id="cas4"> <tr /> <tr> <td>foo</td> <td>boo</td> </tr> </table> <tr /> </table> How would you solve this problem?

    Read the article

  • How to transform html anchor <a> to WordML

    - by Monomachus
    Hi, I need to transform an anchor tag to WordML without using relationships. Is it possible? I found the w: anchor property but seems it refers only to internal document anchors and not to links or URLs. <w:hyperlink w:anchor="chapter3"> <w:r> <w:t>Go to Chapter Three</w:t> </w:r> </w:hyperlink> So it would be great if something similar would be possible to do without making an Id in relationship document and than referring this id from w:hyperlink. Anyone knows something like that?

    Read the article

  • Does lamda in List.ForEach leads to memory leaks and performance problems ?

    - by Monomachus
    I have a problem which I could solve using something like this sortedElements.ForEach((XElement el) => PrintXElementName(el,i++)); And this means that I have in ForEach a lambda which permits using parameters like int i. I like that way of doing it, but i read somewhere that anonymous methods and delegates with lambda leads to a lot of memory leaks because each time when lambda is executed something is instantiated but is not released. Something like that. Could you please tell me if this is true in this situation and if it is why?

    Read the article

  • How to delete an empty column in HTML table using XSLT?

    - by Monomachus
    Hi, How to delete an empty column in HTML table using XSLT, and having something like this: <table id="cas6"> <tr> <td /> <td> <table> <tr> <td>rechin</td> <td /> </tr> <tr> <td>amarillo</td> <td /> </tr> </table> </td> </tr> </table> <table id="cas7"> <tr> <td>rechin</td> <td /> </tr> <tr> <td>amarillo</td> <td /> </tr> <tr> <td>this shouldn't been</td> <td>deleted</td> </tr> </table> To delete the empty column, this being said to remove td's which are empty in all tr's in a Xth position

    Read the article

1