Announcing Support for RTL in the HtmlConverter.cs Module

Hi all,

Today I am announcing support for RTL languages in the HtmlConverter module that is part of PowerTools for Open XML.

RtlConversion-b

Please give it a try and let me know how it goes…

Cheers, Eric

 

Comments (2)

PowerTools for Open XML Road Map, April 2014

I recently completed a new version of ListItemRetriever.cs – which is a super important module in PowerTools for Open XML, although it operates mostly behind the scenes.  This module is responsible for translating the various pieces of markup for numbered and bulleted lists into the actual text that HtmlConverter.cs will place in the generated HTML.  It was a test of my patience – I first patched the old version, then I re-wrote it, and then I threw it all out and re-wrote it again.  I am finally happy with it.

Now that this module is completed, it is time to jump back into some serious coding for the high-fidelity HtmlConverter.cs module.  My next goal is to complete Right-To-Left languages, and East Asian languages.

I always try to do the hard stuff first, and because of my unfamiliarity with the Open XML markup that I need to parse, this is somewhat hard.  Also, because I don’t read any RTL or East Asian languages, I have to do this by pattern matching.  Sure would be easier if I could read them…  :-)

I don’t have a good idea of how long it will take.

Some time ago I wrote a crude program that uses search engines to find Open XML documents on the web and download them.  I have a pretty large collection of them – in general, my work will be to run HtmlConverter.cs on these documents and manually compare the docs in Word with the converted HTML in a browser.  Fun.

But where I’m going – I want to have this high-fidelity conversion from DOCX to HTML in really good shape in the next 2-3 months.

Following that, I want to re-write the portions of PowerTools that we use from PowerShell.  I want to re-write all of the cmdlets using the PowerShell language, not using C#.  After re-writing the cmdlets, I believe that the process to install and use the cmdlets will be a matter of dropping some files in a specific place.  It also will make it much easier for users of PowerTools to build new cmdlets, and to modify the existing cmdlets.

This is my vision for PowerTools for Open XML 3.0.

Cheers, Eric

Comments (5)

New Focus for this Blog

This blog will have a new focus.  Up til now, the blog has been pretty much only on Open XML.  However, now I am going to go much wider afield.  Over the years I’ve gained some experience and insight into certain aspects of being a developer, and I’m going to start blogging about them – things like:

  • How I use PowerShell as a developer
  • My own approach to coverage testing, and why it is different and better
  • My approach to learning new programming languages quickly
  • Using screen-casts for intra-team communication – and how to create screen-casts super quickly
  • How I currently use the cloud as a development tool

I’m also going to discuss some of the more philosophical aspects of being a developer – I’ll even discuss what I did before I worked at Microsoft, and how and why I ended up doing what I’m doing.

And I’m certain I’ll discuss things that I haven’t contemplated yet.

This is going to be fun.

Comments (2)

Whew! Comments are working again on this blog!

First of all, I apologize for neglecting this blog for so long.  I’ve been super busy doing stuff at OpenXmlDeveloper.org, and after interacting there, haven’t had energy for blogging here.  But I’m turning over a new leaf – have some great non-Open-XML content to post here (as well as some Open XML content).

Also, as many of you have noticed, comments have not been working on this blog.  After learning far more than I wanted to about PHP and MySQL, I finally determined that I had a corrupted comments table in MySQL – I installed phpMyAdmin, and then was able to repair the table, and presto, comments started working again!

I will be working on responding to comments (even old ones) here over the next while.  If you leave new comments, I’ll respond to those first, of course!

Comments (4)

Screen-cast series on writing Recursive Pure Functional Transformations

On OpenXMLDeveloper.org, I am publishing a screen-cast series on writing recursive pure functional transforms, which is a powerful programming technique for transforming document-centric XML (such as Open XML WordprocessingML, XHTML, or ODT) into other forms of XML. I have posted four screen-casts in this series. I anticipate that there will be about 20 screen-casts before all is said and done. You can find the complete list here.

Comments (8)

LINQ to XML for JavaScript – Gaining Perf thru Atomization

LINQ to XML for JavaScript uses the same approach for good perf as LINQ to XML for .NET – atomization. Read more: http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2012/10/24/linq-to-xml-for-javascript-gaining-performance-through-atomization.aspx

Comments

LINQ to XML for JavaScript

I’ve been hard at work in my spare time for months now developing a small JavaScript library that enables you to write code in the style of LINQ to XML. I developed this because I needed to implement some interesting functionality in JavaScript, and I already basically had the code written in C#, so writing this library enabled me to translate that C# code to JavaScript with a minimum of fuss and trouble. ltxml.js – LINQ to XML for JavaScript

Comments

Sorting Text in Visual Studio

Sometimes you need to sort some lines of code in Visual Studio – for instance, if you have a long list of Open XML content types, Open XML relationship types, or elements names, you may want that list to be sorted. Here is a little VB snippet (from stackoverflow) that sorts text.

Sub SortLines()
    Dim Selection As TextSelection = DTE.ActiveDocument.Selection
    Dim Lines() As String = Selection.Text.Replace(Environment.NewLine, Chr(13)).Split(Chr(13))
    Array.Sort(Lines)
    DTE.UndoContext.Open("Sort Lines")
    ' Edit - see comments
    ' Selection.Text = String.Join(Environment.NewLine, Lines)
    Selection.Delete()
    Selection.Insert(String.Join(Environment.NewLine, Lines))
    DTE.UndoContext.Close()
End Sub

Posting this here so I can find it again easily.

Comments

Running the SharePoint 2010 IW Demo VM under Windows 8

Here is something that is very cool.  Windows 8 includes Hyper-V, and it is super painless to run the SharePoint 2010 IW Demo VM under Windows 8:

Further, I was able to connect the wireless adapter to the VM, and activate Windows Server 2008 using WIFI. When using this VM under WS2008, it was necessary to physically connect a wire to the computer to do this activation, since there was no way to connect a WIFI adapter so that a VM could connect to the internet.

And, even while the VM is running you can sleep the computer!!!!  How awesome is that! This capability alone makes Windows 8 worth the price of admission.

In a nutshell, here are the steps:

  • Make sure that you have enabled hardware virtualization in your BIOS.
  • Go to Control Panel, then go to Programs and Features
  • Click ‘Turn Windows features on or off’
  • Check the Hyper-V node in the tree control, let it install, and then reboot.
  • Download and unpack the SharePoint 2010 IW Demo VM in the usual way. The remainder of these steps are basically identical to how you setup this VM when using Hyper-V under Windows Server 2008 R2 (with the minor exception that you can use WIFI to activate WS2008 in the VM).
  • Using the Virtual Switch Manager in the Hyper-V Manager, add an internal network adapter (as detailed in Virtual Machine Setup Guide.docx). This guide is available on the same page as the rest of the IW Demo VM. This network should be called ‘Internal’. Set the IP4 address, per the instructions in the Virtual Machine Setup Guide.
  • Import the Virtual Machine.
  • Configure the memory and/or processors as necessary or desired.
  • Boot the VM, and let it stabilize.  It will add drivers and need to reboot. After rebooting, and letting the machine do all of its JITting, you can start IE and see SharePoint 2010 running.
  • Shut down the VM.
  • Using the Virtual Switch Manager in the Hyper-V Manager, add the WIFI network adapter.
  • Edit the settings for the 2010-10a VM, and add the WIFI adapter to the Virtual Machine.
  • Boot the machine. If you have WIFI connectivity, you will be able to browse the web from inside the VM.
  • Click Start -> Right-Click Computer -> Properties. You can activate the VM from this dialog box. You now can use this VM without interruption for 180 days.
  • Shut down the VM. Remove the WIFI adapter from the settings for the VM.
  • Reboot, enjoy

Comments (6)

Repeating Content in Document Generation System that uses XPath Expressions in Content Controls

I recently received a very good request for an enhancement to this document generation system.  The request was for a “Repeat” control that works in a similar way to tables, but instead of putting child records into a table, the document generation system generates a repeating section of content.

To review, here is what the template document looked like in the last iteration of this document generation system.  Below, you can see a screen-shot of the template document.  Following that screen-shot, there is a listing of the XML file that contains the data that will be used in the document generation process.

  • The green oval in the template document contains the XPath expression that selects the XML elements that contain the data for each of the documents.  That XPath expression selects the Customer elements in the XML document (also circled with a green oval).
  • Then, having selected the records for documents, the XPath expression in the blue oval selects the child records for the rows in the table.  The context nodes for that XPath expression are the Customer elements selected by the XPath expression in the green oval.  The selected elements in the XML document are encircled by a blue rounded rectangle.
  • And then finally, the XPath expressions circled by red select the values to place in the cells in the table.  In the XML document, the first set of nodes selected by those XPath expressions are also circled with a red oval.

Template1

XML1

The Repeat construct is parallel to that of a table. The following template document is similar in structure to the above template document, except that instead of generating a table, it generates repeating content.

Template2

When generated with the above XML document, the first document in the generated document looks as follows. I have encircled the repeating content with green rounded rectangles:

GenDocs1

Of course, due to the recursive implementation, you can get really elaborate with this setup. You can, for instance have repeating content within repeating content, or conditional content that contains a table within repeating content, and so on.

Download: 12-02-21-Gen-Docs-XPath

Comments (15)

« Previous entries Next Page » Next Page »