Please let me know how to display the page numbers in the generated HTML files using XSLT 1.0
Use can use like
fo:page-sequence master-reference="id-1" in you xslt
Related
I'm trying to automate process of pinging a person on a messenger on selecting the messenger name(Nayan)
Please find the Html code
<div class="Presence__text">
<span class="Presence__nameText">Nayan<span class="Presence__contactFlagIndicator"></span>
as text element present inside the span tag is unique (Nayan), i want to select based on that text element.
Problem statement :Unable to select an element using text present in span tag
I wanted to open the text of "Nayan" using xpath, can anyone help me solving this problem please.
XPath can be used to locate elements based on their text content.
Accordingly to presented here HTML the following XPath can be used:
"//span[contains(text(),'Nayan')]"
Selenium command using this XPath in Java (you didn't mention the language you are using, but accordingly to your previous questions I see you are using Java) can be as following:
driver.findElement(By.xpath("//span[contains(text(),'Nayan')]"));
In case "Nayan" text is unique it's always better to use contains rather to use equals method since web element may contain extra spaces.
I mean when possible [contains(text(),'Nayan')] is better to use than [text()='Nayan']
Also, since you are using Selenium it can be Xpath 1.0 only since Selenium not supporting Xpath 2.0 and higher, it supports XPath 1.0 only
I'm trying to build a REST API where I send back some resources using a single HTML element as a representation instead of a complete document. For example instead of
<html>
<body>
<table>....</table>
</body>
</html>
I just want to return the Table element and its content.
Using the HTML DSL directly with call.respondHtml I only can create complete HTML documents with all the boilerplate.
If I build an XML document by hand and try to send this back with call.respondHtml, I only get an empty HTML document.
Is there a way to do what I want with the HTML DSL in KTOR or do I have to fall back to serializing the XML document by hand? Or would be using a template engine a better way?
If you have your table built as a child template, you can return it as demonstrated below:
call.respondText(
buildString {
appendHTML().div {
insert(TableTemplate(), TemplatePlaceholder())
}
}
)
It doesn't build the whole HTML document, but you template is embedded in another div.
Related post: ktor - is there a way to serialize sub-template Template<FlowContent> to txt/html?
Ktor docs: https://github.com/Kotlin/kotlinx.html/wiki/Streaming
I am using IntelliJ 2017.2 ultimate edition and I have created a live template to surround text in xhtml (JSF) by a tag and attribute.
#{myvalue}
should become
<h:outputText value="#{myvalue}" />
I created a live template named "swot" applicable to in XML : XML Text.
<h:outputText value="$SELECTION$" />
Unfortunately, it does not show up when I try to surround a selection in a xhtml file. I only get standard live templates.
Update with solution
As the file in which I want to applicate the template is JSF xhtml file, I just had to applicate it to "JSP"
As the file in which I want to applicate the template is JSF xhtml file, I just had to applicate it to "JSP"
Setting the applicability to HTML should solve your issue. Please see below image:
Is there a list to show what XHTML tags and CSS attributes are supported by docx4j XHTML importer?
Thanks.
*Disclosure: I wrote the docx4j code in question *
There is no definitive list. However, there is support for at least:
p, div, li
table
h1 to h3
table
img
span
a
br
There is no support for font color right now, nor u (underline).
Support is a 2 phase affair:
Flying Saucer (XHTMLRenderer) needs to support it
FS supports pretty much all of CSS 2.1; see What_XHTML CSS_features_does_Flying_Saucer_currently_support
docx4j needs to convert the relevant Flying Saucer construct to WordML
If in doubt, just try it on the XHTML of interest to you.
I format text with javascript and after that I store it in database, but when I get this text from database and display in a template then django do not apply css format tags, and just display them as text instead of apply. Please tell what is the problem?
maybe you need to use the safe-filter in your template
see the django docu here!