google blogger The element type "link" must be terminated by the matching end-tag "</link>" - nlp-question-answering

org.xml.sax.SAXParseException; lineNumber: 2964; columnNumber: 7; The element type "link" must be terminated by the matching end-tag "".
enter image description here

Related

InvalidSelectorException: Message: invalid selector: The result of the xpath expression is [object Attr]. It should be an element using XPath Selenium

Hi I want to locate the href element connected to a student named "John Doe" based on the following-sibling input value of 'ST'. This the code im using to select the element:
driver.find_element_by_xpath('//a[following-sibling::input[#value="ST"]]/#href').click()
It's locating the correct element but im getting this error:
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: The result of the xpath expression "//a[following-sibling::input[#value="ST"]]/#href" is: [object Attr]. It should be an element.
How can I fix this?
This error message...
selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: The result of the xpath expression "//a[following-sibling::input[#value="ST"]]/#href" is: [object Attr]. It should be an element.
......implies that your XPath expression was not a valid xpath expression.
For the record
Selenium WebDriver supports xpath-1.0 only which returns the set of node(s) selected by the xpath.
You can find the xpath-1.0 specifications in XML Path Language (XPath) Version 1.0
Where as the xpath expression you have used:
driver.find_element_by_xpath('//a[following-sibling::input[#value="ST"]]/#href')
Is a xpath-2.0 based expression and would typically return an object Attr. A couple of examples:
//#version: selects all the version attribute nodes that are in the same document as the context node
../#lang: selects the lang attribute of the parent of the context node
You can find the xpath-2.0 specifications in XML Path Language (XPath) 2.0 (Second Edition)
Solution
To locate the desired element with a href attribute connected to a student named "John Doe" based on the following-sibling input value of ST you can use either of the following xpath based Locator Strategies:
Using preceding:
driver.find_element_by_xpath("//input[#value='ST']//preceding::a[1]").click()
Using preceding-sibling:
driver.find_element_by_xpath("//input[#value='ST']//preceding-sibling::a[#href]").click()

My less page getting an error If I bundle files?

I realized that some css are not applied on my page if I use bundling some less and css files.
yield return new StyleBundle("~/app/son/styles")
.Include(
"~/angular/angular-ui-select/select.css",
"~/less/bootstrap-slider.less",
"~/less/less/bootstrap-switch.less",
"~/less/employee.less");
When I check the applied less page it s giving an error like that:
Minification failed. Returning unminified contents.
(248,6): run-time error CSS1035: Expected colon, found '{'
(291,5): run-time error CSS1035: Expected colon, found 'input'
(298,5): run-time error CSS1035: Expected colon, found 'input'
(309,5): run-time error CSS1035: Expected colon, found '{'
(326,12): run-time error CSS1035: Expected colon, found '{'
For example for first error line is like that
248.line(pre {):
.example {
pre {
font-size: 14px;
}
And 298 line (td input[type="number"]):
.large-rows {
td input[type="number"] {
width: 120px;
margin-left: 4px;
}
}
As I understand my less file does not behave as less file. why I m getting these errors?

vim syntax: match only when between other matches

I am trying to create a syntax file for my logfiles. They take the format:
[time] LEVEL filepath:line - message
My syntax file looks like this:
:syn region logTime start=+^\[+ end=+\] +me=e-1
:syn keyword logCritical CRITICAL skipwhite nextgroup=logFile
:syn keyword logError ERROR skipwhite nextgroup=logFile
:syn keyword logWarn WARN skipwhite nextgroup=logFile
:syn keyword logInfo INFO skipwhite nextgroup=logFile
:syn keyword logDebug DEBUG skipwhite nextgroup=logFile
:syn match logFile " \S\+:" contained nextgroup=logLineNumber
:syn match logLineNumber "\d\+" contained
The issue I have is that if the string ERROR or DEBUG or something occurs within the message, it gets highlighted. But I don't want it to. I want it so that the keywords only get highlighted if they fall immediately after the time and immediately before the filepath.
How is this done?
Using a test file that looks like this:
[01:23:45] ERROR /foo/bar:42 - this is a log message
[01:23:45] ERROR /foo/bar:42 - this is a ERROR log message
[01:23:45] CRITICAL /foo/bar:42 - this is a log message
[01:23:45] CRITICAL /foo/bar:42 - this is a CRITICAL log message
This syntax file works for me and does not highlight those keywords in the message portion.
" Match the beginning of a log entry. This match is a superset which
" contains other matches (those named in the "contains") parameter.
"
" ^ Beginning of line
" \[ Opening square bracket of timestamp
" [^\[\]]\+ A class that matches anything that isn't '[' or ']'
" Inside a class, ^ means "not"
" So this matches 1 or more non-bracket characters
" (in other words, the timestamp itself)
" The \+ following the class means "1 or more of these"
" \] Closing square bracket of timestamp
" \s\+ Whitespace character (1 or more)
" [A-Z]\+ Uppercase letter (1 or more)
"
" So, this matches the timestamp and the entry type (ERROR, CRITICAL...)
"
syn match logBeginning "^\[[^\[\]]\+\]\s\+[A-Z]\+" contains=logTime,logCritical,logError,logWarn,logInfo,logDebug
" A region that will match the timestamp. It starts with a bracket and
" ends with a bracket. "contained" means that it is expected to be contained
" inside another match (and above, logBeginning notes that it contains logTime).
" The "me" parameter e-1 means that the syntax match will be offset by 1 character
" at the end. This is usually done when the highlighting goes a character too far.
syn region logTime start=+^\[+ end=+\] +me=e-1 contained
" A list of keywords that define which types we expect (ERROR, WARN, etc.)
" These are all marked contained because they are a subset of the first
" match rule, logBeginning.
syn keyword logCritical CRITICAL contained
syn keyword logError ERROR contained
syn keyword logWarn WARN contained
syn keyword logInfo INFO contained
syn keyword logDebug DEBUG contained
" Now that we have taken care of the timestamp and log type we move on
" to the filename and the line number. This match will catch both of them.
"
" \S\+ NOT whitespace (1 or more) - matches the filename
" : Matches a literal colon character
" \d\+ Digit (1 or more) - matches the line number
syn match logFileAndNumber " \S\+:\d\+" contains=logFile,logLineNumber
" This will match only the log filename so we can highlight it differently
" than the line number.
syn match logFile " \S\+:" contained
" Match only the line number.
syn match logLineNumber "\d\+" contained
You might be curious why instead of just using various matches, I used contained matches. That's because some matches like \d\+ are too generic to match anywhere in the line and be right - using contained matches they can be grouped together into patterns that are more likely to be correct. In an earlier revision of this syntax file, some example lines were wrong because for instance if "ERROR" showed up in the log entry text later in the line, it would be highlighted. But in this definition, those keywords only match if they are next to a timestamp which shows up at the beginning of the line only. So the containers are a way to match more precisely but also keep the regexes under control as far as length and complexity.
Update: Based on the example lines you provided (noted below), I have improved the regex on the first line above and in my testing, it works properly now.
[2015-10-05 13:02:27,619] ERROR /home/admusr/autobot/WebManager/wm/operators.py:2371 - Failed to fix py rpc info: [Errno 2] No such file or directory: '/opt/.djangoserverinfo'
[2015-10-05 13:02:13,147] ERROR /home/admusr/autobot/WebManager/wm/operators.py:3223 - Failed to get field "{'_labkeys': ['NTP Server'], 'varname': 'NTP Server', 'displaygroup': 'Lab Info'}" value from lab info: [Errno 111] Connection refused
[2015-10-05 13:02:38,012] ERROR /home/admusr/autobot/WebManager/wm/operators.py:3838 - Failed to add py rpc info: [Errno 2] No such file or directory: '/opt/.djangoserverinfo'
[2015-10-05 12:39:22,835] DEBUG /home/admusr/autobot/WebManager/wm/operators.py:749 - no last results get: [Errno 2] No such file or directory: u'/home/admusr/autobot/admin/branches/Wireless_12.2.0_ewortzman/.lastresults'

How can I use '<' in the value attribute of a component [duplicate]

This question already has an answer here:
How to insert special characters like & and < into JSF components' value attribute?
(1 answer)
Closed 6 years ago.
When I try to name my a4j:commandButton by the value <<
Like that
<a4j:commandButton id="myButton"
value="<<"
render="myGrid"
styleClass="style_btn"
disabled="false" />
There is an error occure
My debugging trace
Error Traced[line: 88] The value of attribute "value" associated with an element type "null" must not contain the '<' character.] with root cause
javax.faces.view.facelets.FaceletException: Error Parsing /screens/s1.xhtml: Error Traced[line: 88] The value of attribute "value" associated with an element type "null" must not contain the '<' character.
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:390)
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:364)
Use XML/HTML entities to insert < or > in an XML file :
value="<<"

Using & in URL causes XML error: The reference to entity "foo" must end with the ';' delimiter

I'm trying to get google map image with the following code:
<img src="http://maps.googleapis.com/maps/api/staticmap?center=#{profile.latitude},#{profile.longitude}&zoom=14&size=400x400&sensor=false"/>
but I get exception in my browser which says:
Error Parsing /content/profile.xhtml:
Error Traced [line: 48] The reference to entity "zoom" must end with the ';' delimiter.
How can I avoid interpreting & in URL as XML?
Replace & with & as the markup is being parsed as XML and &zoom is being parsed as an HTML entity which does not exist in XML.

Resources