Download: Sample Files
When using the AH Formatter GUI, you can drag a file or a combination of files onto the WYSIWYG window and have them formatted automatically.
This tutorial uses AH Formatter GUI plus Windows Explorer as shown in the following figure:
The simplest and most straightforward way to do drag-and-drop formatting is by dragging single files onto AH Formatter GUI.
XML files without a xml-stylesheet
processing instruction are formatted by applying the default CSS stylesheet.
sample.xml contains a single <text>
element:
<text>こんにちは世界/hello world.</text>
<text>
elements, however, so the text is presented unstyled.
XML files with a xml-stylesheet
processing instruction are formatted by applying the stylesheet referred to in the processing instruction.
fo.xml similarly contains a single <text>
element, but it also has a xml-stylesheet
processing instruction referring to fo.xsl:
<?xml-stylesheet href="fo.xsl" ?>
<text>こんにちは世界/hello world.</text>
fo.xsl produces a minimal FO document that formats <text>
and <p>
elements as bold:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xml:lang="ja">
<fo:layout-master-set>
<fo:simple-page-master master-name="PageMaster">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="PageMaster">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="text | p">
<fo:block font-weight="bold">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
html.xml similarly contains a single <text>
element, but it has a xml-stylesheet
processing instruction referring to html.xsl:
<?xml-stylesheet href="html.xsl" ?>
<text>こんにちは世界/hello world.</text>
html.xsl produces a minimal HTML document that represents <text>
and <p>
elements as <p>
with underlined text:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html"/>
<xsl:template match="text | p">
<p style="text-decoration: underline">
<xsl:apply-templates/>
</p>
</xsl:template>
</xsl:stylesheet>
background-color.xml similarly contains a singe <text>
element, but it also has a xml-stylesheet
processing instruction referring to background-color.css:
<?xml-stylesheet href="background-color.css" ?>
<text>こんにちは世界/hello world.</text>
background-color.css has a rule for <text>
and <p>
elements that sets the background-color property:
text, p {
display: block;
background-color: #f0fff0;
}
HTML files without either a xml-stylesheet
processing instruction or a <link>
that refers to a stylesheet are formatted by applying the default CSS stylesheet.
sample.html
contains a singe <p>
element:
<p>こんにちは世界/hello world.</p>
sample.html
onto AH Formatter GUI.<p>
in sample.html, so its text is slightly lower compared with the formatted sample.xml because of the padding specified in the stylesheet.
HTML files with a xml-stylesheet
processing instruction are formatted by applying the stylesheet referred to in the processing instruction.
fo.html is similar to fo.xml but it contains a single <p>
element instead of a <text>
element:
<?xml-stylesheet href="fo.xsl" ?>
<p>こんにちは世界/hello world.</p>
fo.xsl is as you saw above.
html.html
is a minimal HTML document that also has a xml-stylesheet
processing instruction referring to html.xsl:
<?xml-stylesheet href="html.xsl" ?>
<html>
<body>
<p>こんにちは世界/hello world.</p>
</body>
</html>
html.xsl is as you saw above.
xml-stylesheet
to CSSborder.html is a minimal HTML document that also has a xml-stylesheet
processing instruction referring to border.css:
<?xml-stylesheet href="border.css" ?>
<html>
<body>
<p>こんにちは世界/hello world.</p>
</body>
</html>
border.css has a rule for <text>
and <p>
elements that sets the border property:
text, p {
border: thin solid green;
}
<link>
to CSScolor.html is a minimal HTML document that has a <link>
element referring to color.css:
<html>
<head>
<link rel="stylesheet" href="color.css"/>
</head>
<body>
<p>こんにちは世界/hello world.</p>
</body>
</html>
color.css has a rule for <text>
and <p>
elements that sets the color property:
text, p {
color: green;
}
<link>
element:
FO files are formatted directly:
AH Formatter renders graphics in Sample Files
When using the AH Formatter GUI, you can drag a file or a combination of files onto the WYSIWYG window and have them formatted automatically.
This tutorial uses AH Formatter GUI plus Windows Explorer as shown in the following figure:
The simplest and most straightforward way to do drag-and-drop formatting is by dragging single files onto AH Formatter GUI.
XML files without a xml-stylesheet
processing instruction are formatted by applying the default CSS stylesheet.
sample.xml contains a single <text>
element:
<text>こんにちは世界/hello world.</text>
<text>
elements, however, so the text is presented unstyled.
XML files with a xml-stylesheet
processing instruction are formatted by applying the stylesheet referred to in the processing instruction.
fo.xml similarly contains a single <text>
element, but it also has a xml-stylesheet
processing instruction referring to fo.xsl:
<?xml-stylesheet href="fo.xsl" ?>
<text>こんにちは世界/hello world.</text>
fo.xsl produces a minimal FO document that formats <text>
and <p>
elements as bold:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/">
<fo:root xml:lang="ja">
<fo:layout-master-set>
<fo:simple-page-master master-name="PageMaster">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="PageMaster">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="text | p">
<fo:block font-weight="bold">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
html.xml similarly contains a single <text>
element, but it has a xml-stylesheet
processing instruction referring to html.xsl:
<?xml-stylesheet href="html.xsl" ?>
<text>こんにちは世界/hello world.</text>
html.xsl produces a minimal HTML document that represents <text>
and <p>
elements as <p>
with underlined text:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html"/>
<xsl:template match="text | p">
<p style="text-decoration: underline">
<xsl:apply-templates/>
</p>
</xsl:template>
</xsl:stylesheet>
background-color.xml similarly contains a singe <text>
element, but it also has a xml-stylesheet
processing instruction referring to background-color.css:
<?xml-stylesheet href="background-color.css" ?>
<text>こんにちは世界/hello world.</text>
background-color.css has a rule for <text>
and <p>
elements that sets the background-color property:
text, p {
display: block;
background-color: #f0fff0;
}
HTML files without either a xml-stylesheet
processing instruction or a <link>
that refers to a stylesheet are formatted by applying the default CSS stylesheet.
sample.html
contains a singe <p>
element:
<p>こんにちは世界/hello world.</p>
sample.html
onto AH Formatter GUI.<p>
in sample.html, so its text is slightly lower compared with the formatted sample.xml because of the padding specified in the stylesheet.
HTML files with a xml-stylesheet
processing instruction are formatted by applying the stylesheet referred to in the processing instruction.
fo.html is similar to fo.xml but it contains a single <p>
element instead of a <text>
element:
<?xml-stylesheet href="fo.xsl" ?>
<p>こんにちは世界/hello world.</p>
fo.xsl is as you saw above.
html.html
is a minimal HTML document that also has a xml-stylesheet
processing instruction referring to html.xsl:
<?xml-stylesheet href="html.xsl" ?>
<html>
<body>
<p>こんにちは世界/hello world.</p>
</body>
</html>
html.xsl is as you saw above.
xml-stylesheet
to CSSborder.html is a minimal HTML document that also has a xml-stylesheet
processing instruction referring to border.css:
<?xml-stylesheet href="border.css" ?>
<html>
<body>
<p>こんにちは世界/hello world.</p>
</body>
</html>
border.css has a rule for <text>
and <p>
elements that sets the border property:
text, p {
border: thin solid green;
}
<link>
to CSScolor.html is a minimal HTML document that has a <link>
element referring to color.css:
<html>
<head>
<link rel="stylesheet" href="color.css"/>
</head>
<body>
<p>こんにちは世界/hello world.</p>
</body>
</html>
color.css has a rule for <text>
and <p>
elements that sets the color property:
text, p {
color: green;
}
<link>
element:
FO files are formatted directly:
AH Formatter renders graphics in supported formats directly in the WYSIWYG window.
ahlogo.svg
onto AH Formatter GUI.
AH Formatter follows Windows shortcuts and opens the file to which the shortcut refers.
AH Formatter resolves Windows URL files and opens the resource to which the URL refers.
AH Formatter resolves URLs that are dropped as text into the WYSIWYG window.
AH Formatter transforms the XML file using the XSLT file when both are dragged onto AH Formatter GUI.
AH Formatter formats the XML file using the CSS stylesheet when both are dragged onto AH Formatter GUI.
AH Formatter transforms the HTML file using the XSLT file when both are dragged onto AH Formatter GUI.
AH Formatter formats the HTML file using the CSS stylesheet when both are dragged onto AH Formatter GUI.
You can use AH Formatter GUI to apply different stylesheets to the one source file or use it to apply one stylesheet to multiple source files.
The same can be done with a HTML file and different stylesheets.
Unlike a source file followed by successive stylesheets, when the first file is a stylesheet file, dragging another source file onto AH Formatter GUI does not apply the same stylesheet to the new source file.
The drag-and-drop feature of AH Formatter GUI makes it easy to quickly preview XML, HTML, and graphic files that you have on your computer or, even, that you can access with your web browser.
" class="external" rel="noopener" target="_blank">supported formats directly in the WYSIWYG window.
ahlogo.svg
onto AH Formatter GUI.
AH Formatter follows Windows shortcuts and opens the file to which the shortcut refers.
AH Formatter resolves Windows URL files and opens the resource to which the URL refers.
AH Formatter resolves URLs that are dropped as text into the WYSIWYG window.
AH Formatter transforms the XML file using the XSLT file when both are dragged onto AH Formatter GUI.
AH Formatter formats the XML file using the CSS stylesheet when both are dragged onto AH Formatter GUI.
AH Formatter transforms the HTML file using the XSLT file when both are dragged onto AH Formatter GUI.
AH Formatter formats the HTML file using the CSS stylesheet when both are dragged onto AH Formatter GUI.
You can use AH Formatter GUI to apply different stylesheets to the one source file or use it to apply one stylesheet to multiple source files.
The same can be done with a HTML file and different stylesheets.
Unlike a source file followed by successive stylesheets, when the first file is a stylesheet file, dragging another source file onto AH Formatter GUI does not apply the same stylesheet to the new source file.
The drag-and-drop feature of AH Formatter GUI makes it easy to quickly preview XML, HTML, and graphic files that you have on your computer or, even, that you can access with your web browser.