body: Object
und: Array[1]
0: Object
format: "full_html"
safe_summary: ""
safe_value: "<p dir="rtl" style="text-align: justify;">اگر دوست دارید قدرت دویدنتان زیاد شود و بیشتر بدوید و آسیب های ناشی از دویدن را هم نداشه باشید توصیه های زیر را بخوانید تا موفقیت خوبی هنگام دویدن نصیبتان شود.<br /><strong>1- هر روز بدوید</strong><br />تداوم، کلید موفقیت در برنامه است. اگر هر روز بدوید، توانایی بدن برای سوزاندن چربی هم بیشتر می شود.<br /><br /><strong>2- لباس مناسب برای دویدن بپوشید</strong><br />بلوز، شلوار و کفش ورزشی مناسب برای دویدن بپوشید. این کار هم بدن شما را در بهترین فرم و حالت نگه می دارد و هم انگیزه بخش بوده و یک وسیله تشویقی برای دویدن محسوب می شود.<br /><br /><strong>3- انعطاف پذیری خودتون را افزایش بدهید</strong><br />از تجهیزات ورزشی مناسب برای افزایش انعطاف پذیری بدن استفاده کنید تا در زمان دویدن، توانایی و ظرفیت بیشتری داشته باشید. مثلاً می توانید سه جلسه در هفته از بالش پیلاتس استفاده کنید. استفاده از این وسیله، احتمال جراحت هنگام دویدن را کمتر کرده و اثرات مفیدتری نسبت به حرکات کششی ایستا دارد<br /> <br /><strong>4- برای دویدن دلیل داشته باشید</strong><br />به یاد داشته باشید که شما از فرصت فوق العاده ای در زندگی بهرمند هستید که شاید خیلی از افراد دیگر، این فرصت رو نداشته باشند و به هر دلیلی نتوانند بدوند. این یک دلیل فوق العاده مهم و ارزشمند است. این فرصت را که به طور طبیعی در اختیار شما قرار داده شده است، هدر ندهید.<br /><br /><strong>5- هنگام دویدن لباس های خیلی گرم یا زیاد نپوشید</strong><br />همیشه طوری لباس بپوشید که انگار دمای محیط چند درجه گرم تر از میزان واقعی آن است. چون وقتی که شروع به دویدن می کنید، بدن به طور خود به خود گرم می شود و اگر لباس زیادی پوشیده باشید، احساس گرمای طاقت فرسایی خواهید کرد.<br />هرچه انعطاف بدن بیشتر باشد احتمال جراحت هنگام دویدن کمتر است<br /><br /><strong>6- با دونده های دیگر خودتان را مقایسه نکنید</strong><br />خودتان را با خودتان مقایسه کنید نه با بقیه دونده ها. مسلماً همیشه فرد یا افرادی وجود دارند که از شما سریع تر می دوند و ورزشکار تر به نظر می رسند. بر روی پیشرفت خودتان تمرکز کنید و افکار منفی و دلسرد کننده را از خودتان دور کنید.<br /><br /><strong>7- برای دویدن از سطوح شیب دار استفاده نکنید</strong><br />هیچ وقت در سراشیب تپه ها ندوید. نیروی بسیار شدید که با دویدن در سراشیب به زانو ها وارد می شود، برای زانوها مضر است.<br /><br /><strong>8- هر روز به خودتان فشار نیاورید</strong><br />برای تقویت بدن، باید به آن فرصت بدهید تا به بازسازی خود بپردازد. پس نباید هر روز با شدت خیلی زیاد ورزش کنید. بعضی از روزهای هفته به ورزش با شدت کمتر بپردازید.<br /><br /><strong>9- به صورت گروهی بدوید</strong><br />دویدن حتی به صورت انفرادی هم لذتبخش است اما اگر فرد اجتماعی هستید و دوستانی دارید که به شما انگیزه می دهند، بهتر است که با هم به دویدن بپردازید.<br /><br /><strong>10- هنگام دویدن یک هدف مشخص تعیین کنید</strong><br />مثلاً با خودتان قرار بگذارید که یک ربع بدوید یا مثلاً چهار کیلومتر بدوید. سعی کنید که به هدفی که تعیین کرده اید، برسید.</p>↵"
summary: ""
value: "<p dir="rtl" style="text-align: justify;">اگر دوست دارید قدرت دویدنتان زیاد شود و بیشتر بدوید و آسیب های ناشی از دویدن را هم نداشه باشید توصیه های زیر را بخوانید تا موفقیت خوبی هنگام دویدن نصیبتان شود.<br><strong>1- هر روز بدوید</strong><br>تداوم، کلید موفقیت در برنامه است. اگر هر روز بدوید، توانایی بدن برای سوزاندن چربی هم بیشتر می شود.<br><br><strong>2- لباس مناسب برای دویدن بپوشید</strong><br>بلوز، شلوار و کفش ورزشی مناسب برای دویدن بپوشید. این کار هم بدن شما را در بهترین فرم و حالت نگه می دارد و هم انگیزه بخش بوده و یک وسیله تشویقی برای دویدن محسوب می شود.<br><br><strong>3- انعطاف پذیری خودتون را افزایش بدهید</strong><br>از تجهیزات ورزشی مناسب برای افزایش انعطاف پذیری بدن استفاده کنید تا در زمان دویدن، توانایی و ظرفیت بیشتری داشته باشید. مثلاً می توانید سه جلسه در هفته از بالش پیلاتس استفاده کنید. استفاده از این وسیله، احتمال جراحت هنگام دویدن را کمتر کرده و اثرات مفیدتری نسبت به حرکات کششی ایستا دارد<br> <br><strong>4- برای دویدن دلیل داشته باشید</strong><br>به یاد داشته باشید که شما از فرصت فوق العاده ای در زندگی بهرمند هستید که شاید خیلی از افراد دیگر، این فرصت رو نداشته باشند و به هر دلیلی نتوانند بدوند. این یک دلیل فوق العاده مهم و ارزشمند است. این فرصت را که به طور طبیعی در اختیار شما قرار داده شده است، هدر ندهید.<br><br><strong>5- هنگام دویدن لباس های خیلی گرم یا زیاد نپوشید</strong><br>همیشه طوری لباس بپوشید که انگار دمای محیط چند درجه گرم تر از میزان واقعی آن است. چون وقتی که شروع به دویدن می کنید، بدن به طور خود به خود گرم می شود و اگر لباس زیادی پوشیده باشید، احساس گرمای طاقت فرسایی خواهید کرد.<br>هرچه انعطاف بدن بیشتر باشد احتمال جراحت هنگام دویدن کمتر است<br><br><strong>6- با دونده های دیگر خودتان را مقایسه نکنید</strong><br>خودتان را با خودتان مقایسه کنید نه با بقیه دونده ها. مسلماً همیشه فرد یا افرادی وجود دارند که از شما سریع تر می دوند و ورزشکار تر به نظر می رسند. بر روی پیشرفت خودتان تمرکز کنید و افکار منفی و دلسرد کننده را از خودتان دور کنید.<br><br><strong>7- برای دویدن از سطوح شیب دار استفاده نکنید</strong><br>هیچ وقت در سراشیب تپه ها ندوید. نیروی بسیار شدید که با دویدن در سراشیب به زانو ها وارد می شود، برای زانوها مضر است.<br><br><strong>8- هر روز به خودتان فشار نیاورید</strong><br>برای تقویت بدن، باید به آن فرصت بدهید تا به بازسازی خود بپردازد. پس نباید هر روز با شدت خیلی زیاد ورزش کنید. بعضی از روزهای هفته به ورزش با شدت کمتر بپردازید.<br><br><strong>9- به صورت گروهی بدوید</strong><br>دویدن حتی به صورت انفرادی هم لذتبخش است اما اگر فرد اجتماعی هستید و دوستانی دارید که به شما انگیزه می دهند، بهتر است که با هم به دویدن بپردازید.<br><br><strong>10- هنگام دویدن یک هدف مشخص تعیین کنید</strong><br>مثلاً با خودتان قرار بگذارید که یک ربع بدوید یا مثلاً چهار کیلومتر بدوید. سعی کنید که به هدفی که تعیین کرده اید، برسید.</p>"
changed: "1440225054"
cid: "0"
comment: "2"
comment_count: "0"
created: "1440225054"
data: "b:0;"
field_external_link: Array[0]
field_image: Object
field_main_category_field: Object
field_show_slideshow: Object
title_original: "10 نکته برای بهتر دویدن"
This is my json from console that i copy here . This json is comming from Drupal that i want to show some data in ng-repeat .
when i add this to my html :
<div ng-repeat="data in innerData">
{{data.title_original}}
</div>
I'm assuming data is the variable holding the json. If that's true, I don't see any field title_original in it. Therefor, your code won't output anything.
Also, I see your json has some html in it. If you're sure the code is safe and can't inject unwanted tags (such as <script></script>), you should use the directive ng-bind-html to show that content and actually interpret it as HTML. This uses the sanitize module from angular.
See: https://docs.angularjs.org/api/ng/directive/ngBindHtml
Related
I have an application in AngularJS (I'm begginer..sorry!) that needs to show diferents tables when I click on the menu.
Problem: simulado1.htm is appearing when I click in the menu, but its table isn't.
What should I do?
It's a SPA using the ng-route and
Thanks everybody!
<!DOCTYPE html>
<html ng-app="app1">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-route.js"></script>
<script src="scripts/route-config.js"></script>
<script src="scripts/table.js"></script>
<link rel="stylesheet" href="styles/style.css">
</head>
<header>
<h2>MEDGRUPO</h2>
</header>
<nav>
<div id="menu-simulados">
<ul> <!-- This is a menu to choose which "simulado" (table) you want to -->
<li>Simulado 1</li>
<li>Simulado 2</li>
<li>Simulado 3</li>
</ul>
</div>
</nav>
<body ng-app="myModule">
<div ng-view></div>
</body>
</html>
// ARCHIVE route-config.js //
var app = angular.module("app1", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "main.htm",
controller : "MainCtrl",
})
.when("/simulado1", {
templateUrl : "simulado1.htm",
controller : "Sim1Ctrl",
})
.when("/simulado2", {
templateUrl : "simulado2.htm",
controller : "Sim2Ctrl",
})
.when("/simulado3", {
templateUrl : "simulado3.htm",
controller : "Sim3Ctrl",
});
});
Here it's my archive table.js with the table parameters:
//<reference path="angular.js" />
var app = angular.module("myModule", []).controller("myController", function ($scope) {
var tabela = [
{ posicao: "1", nota: "10", matricula: "897413", especialidade: "clinica medica", turma: "2008 MEDCURSO SALVADOR - Turma A/2008 MED SALVADOR" , filial:"Salvador (BA)" },
{ posicao: "2", nota: "40", matricula: "897413", especialidade: "cardiologia", turma: "2008 MEDCURSO SP - Turma A/2008 MED SP", filial:"São Paulo (SP)" },
{ posicao: "3", nota: "50", matricula: "205500", especialidade: "cardiologia", turma: "2008 MEDCURSO SP - Turma A/2007 MED SP" , filial:"São Paulo (SP)"},
{ posicao: "4", nota: "90", matricula: "897413", especialidade: "pediatria", turma: "2008 MEDCURSO NATAL - Turma A/2008 MED NATAL", filial:"Natal (RN)" },
{ posicao: "5", nota: "80", matricula: "205500", especialidade: "clinica medica", turma: "2008 MEDCURSO NATAL - Turma A/2005 MED NATAL", filial:"Natal (RN)" },
{ posicao: "6", nota: "70", matricula: "897416", especialidade: "clinica medica", turma: "2008 MEDCURSO NATAL - Turma A/2008 MED NATAL", filial:"Natal (RN)" },
{ posicao: "7", nota: "10", matricula: "205500", especialidade: "clinica medica", turma: "2008 MEDCURSO SALVADOR - Turma A/2006 MED SALVADOR", filial:"Salvador (BA)" },
{ posicao: "8", nota: "10", matricula: "897413", especialidade: "urologia", turma: "2008 MEDCURSO SALVADOR - Turma A/2008 MED SALVADOR", filial:"Salvador (BA)" },
{ posicao: "9", nota: "50", matricula: "897415", especialidade: "clinica medica", turma: "2008 MEDCURSO SALVADOR - Turma A/2008 MED SALVADOR", filial:"Salvador (BA)" },
];
$scope.tabela = tabela;
});
// archive simulado1.htm //
<body ng-app="myModule">
<div ng-controller="myController">
Entre com sua Matrícula :
<input type="text" ng-model="searchText.matricula" placeholder="Pesquisar matricula" />
<br><br><br>
<span>
<select ng-model="searchText.especialidade">
<option value="">Especialidades - Todas</option>
<option value="cardiologia">cardiologia</option>
<option value="clinica medica">clinica medica</option>
<option value="pediatria">pediatria</option>
<option value="urologia">urologia</option>
</select>
</span>
<span>
<select ng-model="searchText.turma">
<option value="">Turmas - Todas</option>
<option value="2008 MEDCURSO SALVADOR - Turma A/2008 MED SALVADOR">2008 MEDCURSO SALVADOR - Turma A/2008 MED SALVADOR</option>
<option value="2008 MEDCURSO Natal - Turma A/2008 MED NATAL">2008 MEDCURSO Natal - Turma A/2008 MED NATAL</option>
<option value="2008 MEDCURSO SP - Turma A/2008 MED SP">2008 MEDCURSO SP - Turma A/2008 MED SP</option>
<option value="2008 MEDCURSO SP - Turma A/2007 MED SP">2008 MEDCURSO SP - Turma A/2007 MED SP</option>
<option value="2008 MEDCURSO NATAL - Turma A/2008 MED NATAL">2008 MEDCURSO NATAL - Turma A/2008 MED NATAL</option>
<option value="2008 MEDCURSO NATAL - Turma A/2005 MED NATAL">2008 MEDCURSO NATAL - Turma A/2005 MED NATAL</option>
<option value="2008 MEDCURSO SALVADOR - Turma A/2006 MED SALVADOR">2008 MEDCURSO SALVADOR - Turma A/2006 MED SALVADOR</option>
<option value="2008 MEDCURSO SALVADOR - Turma A/2008 MED SALVADOR">2008 MEDCURSO SALVADOR - Turma A/2008 MED SALVADOR</option>
</select>
</span>
<span>
<select ng-model="searchText.filial">
<option value="">Filiais - Todas</option>
<option value="Natal">Natal</option>
<option value="Salvador">Salvador</option>
<option value="SP">SP</option>
</select>
</span>
<br><br><br>
<span style="width:100%" onclick="imprimir()" class="imprimir">Imprimir |</span>
<div id="tabelaimpressao">
<table>
<thead>
<tr>
<th>Posição</th>
<th>Nota</th>
<th>Matrícula</th>
<th>Especialidade</th>
<th>Turma</th>
<th>Filial</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="simulado in tabela | filter:searchText">
<td> {{ simulado.posicao }} </td>
<td> {{ simulado.nota }} </td>
<td> {{ simulado.matricula }} </td>
<td> {{ simulado.especialidade }} </td>
<td> {{ simulado.turma }} </td>
<td> {{ simulado.filial }} </td>
</tr>
</tbody>
</table>
two fixes:
1. I removed line 9 from index.html because you were linking 2 times the angular file.
2. Corrected your controller's statement without declaring a new module. As:
app.controller ("myController", function ($ scope) {
There your table loaded by clicking on the link.
In simulado1.htm no need to set the ng-app and ng-controller again as you are setting the routes in the router config.
<body ng-app="myModule"> //remove this
<div ng-controller="myController"> //remove this
When I access my index.html I get this
Error page
index.html
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
</body>
</html>
I'm trying to make AngularJS compile in a spring project
console error:
2017-08-18 12:16:00.356 ERROR 90004 --- [io-8084-exec-10] o.thymeleaf.templateparser.ErrorHandler : [THYMELEAF][http-nio-8084-exec-10] Fatal error during parsing
org.xml.sax.SAXParseException: O nome do atributo "ng-app" associado a um tipo de elemento "html" deve ser seguido do caractere ' = '.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) [na:1.8.0_131]
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source) [na:1.8.0_131]
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.doParse(AbstractNonValidatingSAXTemplateParser.java:209) [thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplateUsingPool(AbstractNonValidatingSAXTemplateParser.java:134) [thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplate(AbstractNonValidatingSAXTemplateParser.java:116) [thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:278) [thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) [thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060) [thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011) [thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.spring4.view.ThymeleafView.renderFragment(ThymeleafView.java:335) [thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.spring4.view.ThymeleafView.render(ThymeleafView.java:190) [thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1271) [spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037) [spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980) [spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) [spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) [spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:208) [spring-security-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) [spring-security-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:115) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter.access$000(ErrorPageFilter.java:59) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:90) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:108) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.11.jar:8.5.11]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_131]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.11.jar:8.5.11]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_131]
2017-08-18 12:16:00.356 ERROR 90004 --- [io-8084-exec-10] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8084-exec-10] Exception processing template "index": Exception parsing document: template="index", line 1 - column 29
2017-08-18 12:16:00.357 ERROR 90004 --- [io-8084-exec-10] o.s.boot.web.support.ErrorPageFilter : Forwarding to error page from request [/] due to exception [Exception parsing document: template="index", line 1 - column 29]
org.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template="index", line 1 - column 29
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplateUsingPool(AbstractNonValidatingSAXTemplateParser.java:166) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplate(AbstractNonValidatingSAXTemplateParser.java:116) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:278) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.spring4.view.ThymeleafView.renderFragment(ThymeleafView.java:335) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.spring4.view.ThymeleafView.render(ThymeleafView.java:190) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1271) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:208) ~[spring-security-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) ~[spring-security-web-4.2.1.RELEASE.jar:4.2.1.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:115) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter.access$000(ErrorPageFilter.java:59) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:90) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:108) [spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) [tomcat-embed-core-8.5.11.jar:8.5.11]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.11.jar:8.5.11]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_131]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.11.jar:8.5.11]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_131]
Caused by: org.xml.sax.SAXParseException: O nome do atributo "ng-app" associado a um tipo de elemento "html" deve ser seguido do caractere ' = '.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[na:1.8.0_131]
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source) ~[na:1.8.0_131]
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.doParse(AbstractNonValidatingSAXTemplateParser.java:209) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplateUsingPool(AbstractNonValidatingSAXTemplateParser.java:134) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
... 66 common frames omitted
You should always check the console (in developer tools - in Chrome click F12) to see if there are any errors, but if everything else is right, you need to specify the app name and controller name like this:
HTML:
<html ng-app="appname">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>
<div ng-controller="ctrlname">
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
<h1>Hello {{yourName}}!</h1>
</div>
</body>
</html>
I forgot some things:
ng-app="name"
Close </hr> and </input> tag
How to parse values if I have more than one tags, like in code above.
<formula1>
<team name="McLaren">
<driver>
<name>Abcd</name>
<points>112</points>
</driver>
<driver>
<name>Juan Pablo Montoya</name>
<points>60</points>
</driver>
</team>
</formula1>
<formula1>
<team name="McLaren">
<driver>
<name>Kimi Raikkonen</name>
<points>112</points>
</driver>
<driver>
<name>EFGH</name>
<points>60</points>
</driver>
</team>
</formula1>
I was able to print values between tags in first formula1 () with this code example:
ezxml_t f1 = ezxml_parse_file("formula1.xml");
printf("%s\n", ezxml_get(f1, "team", 0, "driver", 1, "name", -1)->txt);
ezxml_free(f1);
But don't know how to print values from second.
option 1. wrap
xml:
<root>
<formula1>
<team name="McLaren">
<driver>
<name>Abcd</name>
<points>112</points>
</driver>
<driver>
<name>Juan Pablo Montoya</name>
<points>60</points>
</driver>
</team>
</formula1>
<formula1>
<team name="McLaren">
<driver>
<name>Kimi Raikkonen</name>
<points>112</points>
</driver>
<driver>
<name>EFGH</name>
<points>60</points>
</driver>
</team>
</formula1>
</root>
code:
printf("%s\n", ezxml_get(f1, "formula1", 0, "team", 0, "driver", 1, "name", -1)->txt);
printf("%s\n", ezxml_get(f1, "formula1", 1, "team", 0, "driver", 0, "name", -1)->txt);
option 2. unify
xml:
<formula1>
<team name="McLaren">
<driver>
<name>Abcd</name>
<points>112</points>
</driver>
<driver>
<name>Juan Pablo Montoya</name>
<points>60</points>
</driver>
</team>
<team name="McLaren">
<driver>
<name>Kimi Raikkonen</name>
<points>112</points>
</driver>
<driver>
<name>EFGH</name>
<points>60</points>
</driver>
</team>
</formula1>
code:
printf("%s\n", ezxml_get(f1, "team", 0, "driver", 1, "name", -1)->txt);
printf("%s\n", ezxml_get(f1, "team", 1, "driver", 0, "name", -1)->txt);
After the issue in the following Stackoverflow is fixed, I have another problem when I try to make a join as below. The last query takes about 250ms while the first two take only 16ms. Is there a better way to perform join between two items?
Note: You can find the test data from this link.
let $PlGeTys :=
/root/PlGeTys/PlGeTy[
isOfPlCt/#href=/root/PlCts/PlCt[
environment='AIR'
]/#id
]
let $PlSpTys :=
/root/PlSpTys/PlSpTy[
isOfPlGeTy/#href=$PlGeTys/#id
]
for $PlGeTy in $PlGeTys,
$PlSpTy in $PlSpTys
where $PlSpTy/isOfPlGeTy/#href=$PlGeTy/#id
return <done>{$PlGeTy, $PlSpTy }</done>
Here is the query info:
Compiling:
- applying attribute index for $PlGeTys_0/#*:id
- rewriting where clause(s)
Query:
let $PlGeTys := /root/PlGeTys/PlGeTy[ isOfPlCt/#href=/root/PlCts/PlCt[ environment='AIR' ]/#id ] let $PlSpTys := /root/PlSpTys/PlSpTy[ isOfPlGeTy/#href=$PlGeTys/#id ] for $PlGeTy in $PlGeTys, $PlSpTy in $PlSpTys where $PlSpTy/isOfPlGeTy/#href=$PlGeTy/#id return "done"
Optimized Query:
let $PlGeTys_0 := db:open-pre("Output6",0)/*:root/*:PlGeTys/*:PlGeTy[(*:isOfPlCt/#*:href = root()/*:root/*:PlCts/*:PlCt[(*:environment = "AIR")]/#*:id)] let $PlSpTys_1 := db:attribute("Output6", $PlGeTys_0/#*:id)/self::*:href/parent::*:isOfPlGeTy/parent::*:PlSpTy for $PlGeTy_2 in $PlGeTys_0 for $PlSpTy_3 in ($PlSpTys_1)[(isOfPlGeTy/#href = $PlGeTy_2/#*:id)] return "done"
Result:
- Hit(s): 3642 Items
- Updated: 0 Items
- Printed: 18209 Bytes
- Read Locking: local [Output6]
- Write Locking: none
Timing:
- Parsing: 0.77 ms
- Compiling: 0.47 ms
- Evaluating: 215.71 ms
- Printing: 0.17 ms
- Total Time: 217.11 ms
Query plan:
<QueryPlan compiled="true">
<GFLWOR>
<Let>
<Var name="$PlGeTys" id="0"/>
<IterPath>
<DBNode name="Output6" pre="0"/>
<IterStep axis="child" test="*:root"/>
<IterStep axis="child" test="*:PlGeTys"/>
<IterStep axis="child" test="*:PlGeTy">
<CmpG op="=">
<CachedPath>
<IterStep axis="child" test="*:isOfPlCt"/>
<IterStep axis="attribute" test="*:href"/>
</CachedPath>
<IterPath>
<Root/>
<IterStep axis="child" test="*:root"/>
<IterStep axis="child" test="*:PlCts"/>
<IterStep axis="child" test="*:PlCt">
<CmpG op="=">
<CachedPath>
<IterStep axis="child" test="*:environment"/>
</CachedPath>
<Str value="AIR" type="xs:string"/>
</CmpG>
</IterStep>
<IterStep axis="attribute" test="*:id"/>
</IterPath>
</CmpG>
</IterStep>
</IterPath>
</Let>
<Let>
<Var name="$PlSpTys" id="1"/>
<CachedPath>
<ValueAccess data="Output6" type="ATTRIBUTE">
<CachedPath>
<VarRef>
<Var name="$PlGeTys" id="0"/>
</VarRef>
<IterStep axis="attribute" test="*:id"/>
</CachedPath>
</ValueAccess>
<IterStep axis="self" test="*:href"/>
<IterStep axis="parent" test="*:isOfPlGeTy"/>
<IterStep axis="parent" test="*:PlSpTy"/>
</CachedPath>
</Let>
<For>
<Var name="$PlGeTy" id="2"/>
<VarRef>
<Var name="$PlGeTys" id="0"/>
</VarRef>
</For>
<For>
<Var name="$PlSpTy" id="3"/>
<IterFilter>
<VarRef>
<Var name="$PlSpTys" id="1"/>
</VarRef>
<CmpG op="=">
<CachedPath>
<IterStep axis="child" test="isOfPlGeTy"/>
<IterStep axis="attribute" test="href"/>
</CachedPath>
<IterPath>
<VarRef>
<Var name="$PlGeTy" id="2"/>
</VarRef>
<IterStep axis="attribute" test="*:id"/>
</IterPath>
</CmpG>
</IterFilter>
</For>
<Str value="done" type="xs:string"/>
</GFLWOR>
</QueryPlan>
Update two:
The issue above is fixed. But when I want to use it in a local function as below, it takes about 700 ms. Am I doing something wrong?
declare function local:result($root as element(root)) as element()* {
let $PlCts := $root/PlCts/PlCt[environment = 'AIR']/#id
for $PlGeTy in $root/PlGeTys/PlGeTy[isOfPlCt/#href = $PlCts],
$PlSpTy in $root/PlSpTys/PlSpTy[isOfPlGeTy/#href = $PlGeTy/#id]
return <done>{ $PlGeTy, $PlSpTy }</done>
};
let $result := local:result(/root)
return $result
Query info;
Compiling:
- removing redundant element()* cast.
- inlining local:result#1
- inlining $root_5 as element(root)
- simplifying flwor expression
Query:
declare function local:result($root as element(root)) as element()* { let $PlCts := $root/PlCts/PlCt[environment = 'AIR']/#id for $PlGeTy in $root/PlGeTys/PlGeTy[isOfPlCt/#href = $PlCts], $PlSpTy in $root/PlSpTys/PlSpTy[isOfPlGeTy/#href = $PlGeTy/#id] return <done>{ $PlGeTy, $PlSpTy }</done> }; let $result := local:result(/root) return $result
Optimized Query:
let $PlCts_6 := ((: element(root), true :) db:open-pre("Output6",0)/*:root)/PlCts/PlCt[(environment = "AIR")]/#id let $result_4 := for $PlGeTy_7 in ((: element(root), true :) db:open-pre("Output6",0)/*:root)/PlGeTys/PlGeTy[(isOfPlCt/#href = $PlCts_6)] for $PlSpTy_8 in ((: element(root), true :) db:open-pre("Output6",0)/*:root)/PlSpTys/PlSpTy[(isOfPlGeTy/#href = $PlGeTy_7/#id)] return element done { (($PlGeTy_7, $PlSpTy_8)) } return $result_4
Result:
- Hit(s): 3642 Items
- Updated: 0 Items
- Printed: 553 KB
- Read Locking: local [Output6]
- Write Locking: none
Timing:
- Parsing: 1.41 ms
- Compiling: 2.9 ms
- Evaluating: 581.5 ms
- Printing: 8.34 ms
- Total Time: 594.15 ms
Query plan:
<QueryPlan compiled="true">
<GFLWOR>
<Let>
<Var name="$PlCts" id="6"/>
<IterPath>
<TypeCheck type="element(root)" function="true">
<IterPath>
<DBNode name="Output6" pre="0"/>
<IterStep axis="child" test="*:root"/>
</IterPath>
</TypeCheck>
<IterStep axis="child" test="PlCts"/>
<IterStep axis="child" test="PlCt">
<CmpG op="=">
<CachedPath>
<IterStep axis="child" test="environment"/>
</CachedPath>
<Str value="AIR" type="xs:string"/>
</CmpG>
</IterStep>
<IterStep axis="attribute" test="id"/>
</IterPath>
</Let>
<Let>
<Var name="$result" id="4"/>
<GFLWOR>
<For>
<Var name="$PlGeTy" id="7"/>
<IterPath>
<TypeCheck type="element(root)" function="true">
<IterPath>
<DBNode name="Output6" pre="0"/>
<IterStep axis="child" test="*:root"/>
</IterPath>
</TypeCheck>
<IterStep axis="child" test="PlGeTys"/>
<IterStep axis="child" test="PlGeTy">
<CmpG op="=">
<CachedPath>
<IterStep axis="child" test="isOfPlCt"/>
<IterStep axis="attribute" test="href"/>
</CachedPath>
<VarRef>
<Var name="$PlCts" id="6"/>
</VarRef>
</CmpG>
</IterStep>
</IterPath>
</For>
<For>
<Var name="$PlSpTy" id="8"/>
<IterPath>
<TypeCheck type="element(root)" function="true">
<IterPath>
<DBNode name="Output6" pre="0"/>
<IterStep axis="child" test="*:root"/>
</IterPath>
</TypeCheck>
<IterStep axis="child" test="PlSpTys"/>
<IterStep axis="child" test="PlSpTy">
<CmpG op="=">
<CachedPath>
<IterStep axis="child" test="isOfPlGeTy"/>
<IterStep axis="attribute" test="href"/>
</CachedPath>
<IterPath>
<VarRef>
<Var name="$PlGeTy" id="7"/>
</VarRef>
<IterStep axis="attribute" test="id"/>
</IterPath>
</CmpG>
</IterStep>
</IterPath>
</For>
<CElem>
<QNm value="done" type="xs:QName"/>
<List>
<VarRef>
<Var name="$PlGeTy" id="7"/>
</VarRef>
<VarRef>
<Var name="$PlSpTy" id="8"/>
</VarRef>
</List>
</CElem>
</GFLWOR>
</Let>
<VarRef>
<Var name="$result" id="4"/>
</VarRef>
</GFLWOR>
</QueryPlan>
Update three:
Now, I have another issue when I extend the query with the additional "Cont" items, The query execution lasts about 600 ms. But without "Cont" items, it takes only 35 ms.
Do you any suggestion on optimizing this query?
let $PlCts := /root/PlCts/PlCt[environment = 'AIR']/#id
for $PlGeTy in /root/PlGeTys/PlGeTy[isOfPlCt/#href = $PlCts],
$PlSpTy in /root/PlSpTys/PlSpTy[isOfPlGeTy/#href = $PlGeTy/#id],
$Cont in /root/Conts/Cont[#id=$PlSpTy/isOfCont/#href]
return <done>{ $PlGeTy, $PlSpTy, $Cont }</done>
This is the link of the latest XML data for testing.
The query info:
Compiling:
- applying text index for "AIR"
- applying attribute index for $PlCts_0
- applying attribute index for $PlGeTy_1/#id
- applying attribute index for $PlSpTy_2/isOfCont/#href
- inlining $PlCts_0
Query:
let $PlCts := /root/PlCts/PlCt[environment = 'AIR']/#id for $PlGeTy in /root/PlGeTys/PlGeTy[isOfPlCt/#href = $PlCts], $PlSpTy in /root/PlSpTys/PlSpTy[isOfPlGeTy/#href = $PlGeTy/#id], $Cont in /root/Conts/Cont[#id=$PlSpTy/isOfCont/#href] return <done>{ $PlGeTy, $PlSpTy, $Cont }</done>
Optimized Query:
for $PlGeTy_1 in db:attribute("Output7", db:text("Output7", "AIR")/parent::*:environment/parent::*:PlCt/#*:id)/self::*:href/parent::*:isOfPlCt/parent::*:PlGeTy for $PlSpTy_2 in db:attribute("Output7", $PlGeTy_1/#id)/self::*:href/parent::*:isOfPlGeTy/parent::*:PlSpTy for $Cont_3 in db:attribute("Output7", $PlSpTy_2/isOfCont/#href)/self::*:id/parent::*:Cont return element done { (($PlGeTy_1, $PlSpTy_2, $Cont_3)) }
Result:
- Hit(s): 3642 Items
- Updated: 0 Items
- Printed: 1159 KB
- Read Locking: local [Output7]
- Write Locking: none
Timing:
- Parsing: 0.39 ms
- Compiling: 0.68 ms
- Evaluating: 585.29 ms
- Printing: 14.36 ms
- Total Time: 600.72 ms
Query plan:
<QueryPlan compiled="true">
<GFLWOR>
<For>
<Var name="$PlGeTy" id="1"/>
<CachedPath>
<ValueAccess data="Output7" type="ATTRIBUTE">
<CachedPath>
<ValueAccess data="Output7" type="TEXT" name="*:environment">
<Str value="AIR" type="xs:string"/>
</ValueAccess>
<IterStep axis="parent" test="*:PlCt"/>
<IterStep axis="attribute" test="*:id"/>
</CachedPath>
</ValueAccess>
<IterStep axis="self" test="*:href"/>
<IterStep axis="parent" test="*:isOfPlCt"/>
<IterStep axis="parent" test="*:PlGeTy"/>
</CachedPath>
</For>
<For>
<Var name="$PlSpTy" id="2"/>
<CachedPath>
<ValueAccess data="Output7" type="ATTRIBUTE">
<IterPath>
<VarRef>
<Var name="$PlGeTy" id="1"/>
</VarRef>
<IterStep axis="attribute" test="id"/>
</IterPath>
</ValueAccess>
<IterStep axis="self" test="*:href"/>
<IterStep axis="parent" test="*:isOfPlGeTy"/>
<IterStep axis="parent" test="*:PlSpTy"/>
</CachedPath>
</For>
<For>
<Var name="$Cont" id="3"/>
<CachedPath>
<ValueAccess data="Output7" type="ATTRIBUTE">
<IterPath>
<VarRef>
<Var name="$PlSpTy" id="2"/>
</VarRef>
<IterStep axis="child" test="isOfCont"/>
<IterStep axis="attribute" test="href"/>
</IterPath>
</ValueAccess>
<IterStep axis="self" test="*:id"/>
<IterStep axis="parent" test="*:Cont"/>
</CachedPath>
</For>
<CElem>
<QNm value="done" type="xs:QName"/>
<List>
<VarRef>
<Var name="$PlGeTy" id="1"/>
</VarRef>
<VarRef>
<Var name="$PlSpTy" id="2"/>
</VarRef>
<VarRef>
<Var name="$Cont" id="3"/>
</VarRef>
</List>
</CElem>
</GFLWOR>
</QueryPlan>
In those for loops, the results of the two "large" XPath expressions are already cached by the optimizer. Furthermore, you're actually comparing the href/id attributes twice.
Cleaning up the query removing this double effort reduces the execution time by about 90%.
let $PlCts := /root/PlCts/PlCt[environment = 'AIR']/#id
for $PlGeTy in /root/PlGeTys/PlGeTy[isOfPlCt/#href = $PlCts],
$PlSpTy in /root/PlSpTys/PlSpTy[isOfPlGeTy/#href = $PlGeTy/#id]
return <done>{ $PlGeTy, $PlSpTy }</done>
I need to set width of the autocomplete input in the Angular Kendo.
How can i do it programatically please?
Thanks for any help.
Setting it with an initial value, you should use style="width: 200px;".
Example:
<input kendo-auto-complete="my_autocomplete" ng-model="country" k-data-source="countryNames" style="width: 200px" />
If then you need to modify it, you should change the width via css method for wrapper element.
Example
$scope.my_autocomplete.wrapper.css("width", "300px");
angular.module("KendoDemos", [ "kendo.directives" ])
.controller("MyCtrl", function($scope){
$scope.countryNames = [
"Albania",
"Andorra",
"Armenia",
"Austria",
"Azerbaijan",
"Belarus",
"Belgium",
"Bosnia & Herzegovina",
"Bulgaria",
"Croatia",
"Cyprus",
"Czech Republic",
"Denmark",
"Estonia",
"Finland",
"France",
"Georgia",
"Germany",
"Greece",
"Hungary",
"Iceland",
"Ireland",
"Italy",
"Kosovo",
"Latvia",
"Liechtenstein",
"Lithuania",
"Luxembourg",
"Macedonia",
"Malta",
"Moldova",
"Monaco",
"Montenegro",
"Netherlands",
"Norway",
"Poland",
"Portugal",
"Romania",
"Russia",
"San Marino",
"Serbia",
"Slovakia",
"Slovenia",
"Spain",
"Sweden",
"Switzerland",
"Turkey",
"Ukraine",
"United Kingdom",
"Vatican City"
];
setTimeout(function() {
alert("Changing width");
$scope.my_autocomplete.wrapper.css("width", "300px");
}, 4000);
});
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.common.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.default.min.css" />
<script src="http://cdn.kendostatic.com/2014.3.1119/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2014.3.1119/js/angular.min.js"></script>
<script src="http://cdn.kendostatic.com/2014.3.1119/js/kendo.all.min.js"></script>
<div id="example" ng-app="KendoDemos">
<div class="demo-section k-content" ng-controller="MyCtrl">
<input kendo-auto-complete="my_autocomplete" ng-model="country" k-data-source="countryNames" style="width: 200px" />
</div>
</div>