xercesc NodeType not declared - xerces-c

I am developing an application to read XML files using xerces-c-3.1.1 using C++ on Netbeans 8.0.1.
I have a variable defined as type DOMNode* as follows
DOMNode* attribute=attributes->item(aIndex);
When I expand attribute in the debugger, it displays a function, getNodeType(), that returns a variable of type. However,when I add the code
NodeType value=attribute->getNodeType();
I get the error message
error: ‘NodeType’ was not declared in this scope

You could try xercesc::DOMNode::NodeType instead of writing NodeType.

Related

Question about weird behavior referencing a YAML pipeline resource using a variable for the pipeline resource name

I am experiencing weird behavior with YAML variables, parameters, and Azure pipeline resource references. The following shows the original implementation that works compared to my new implementation with a single line change that fails.
Working Implementation
Template A (makes a call to template B):
- template: Templates\TemplateB.yml
serviceBuildResourceName: resourceName
Template B (uses serviceBuildResourceName param to get pipeline run information):
$projectId = '$(resources.pipeline.${{ parameters.serviceBuildResourceName }}.projectID)'
$pipelineId ='$(resources.pipeline.${{ parameters.serviceBuildResourceName }}.PipelineID)'
Template B goes on to use the values in $projectId and $pipelineId (along with other values not listed here since it is irrelevant) to successfully retrieve information about the a pipeline run from the specific pipeline resource, serviceBuildResourceName. Note that all pipeline resources are correctly defined at the beginning yaml file for the pipeline. In this implementation above, everything works perfectly.
Failing Implementation
Template A (makes a call to template B):
- template: Templates\TemplateB.yml
serviceBuildResourceName: $(ServiceBuildResourceName)
Template B (uses serviceBuildResourceName param to get pipeline run information):
$projectId = '$(resources.pipeline.${{ parameters.serviceBuildResourceName }}.projectID)'
$pipelineId ='$(resources.pipeline.${{ parameters.serviceBuildResourceName }}.PipelineID)'
Note that the only difference is the following: instead of passing the hard-coded string into the serviceBuildResourceName parameter, I pass in a variable, which has the same value as before, resourceName. The variable is defined in an earlier template as such:
- name: ServiceBuildResourceName
value: resourceName
I feel it should still work the same, but I know get the following error in my pipeline run:
WARNING: 2023-02-12 15:52:29.5071 Response body: {"$id":"1","innerException":null,"message":"The value is not an integer.
$(resources.pipeline.resourceName.PipelineID)
I know that the variable is being correctly populated since the error message above contains "resourceName" in resources.pipeline.resourceName.PipelineID, as it should.
However, for reasons unknown to me, it now throughs an error. It seems like it doesn't recognize the pipeline resource, and instead recognizes it as a string.
Any help or insight here would be greatly appreciated, thanks!
As far as I can tell, this is because of how predefined variables work in YAML. Since resources.pipeline... is a predefined variable, it gets resolved at compile time. Thus, you can't use run-time defined variables like I am doing. Instead of resolving it as a predefined variable, it will get resolved to be a string at runtime.

Can not extract value in SOAPUI property transfer using xPath and namespaces

I try to extract value from xml in Property Transfer I use xPath:
declare namespace S="http://www.w3.org/2003/05/soap-envelope"
declare namespace ns7="http://schemas.BIGBANK.pl/" xmlns="http://schemas.BIGBANK.pl/"
/S:Envelope/S:Body/ns7:Document/ns7:QueryIPR/ns7:IPIList/ns7:PI/ns7:PI/ns7:cId/
and i get error:
cId [net.sf.saxon.trans.XPathException: Required item type of first operand of '/' is node(); supplied value has item type xs:string]
I set source of transfer as previous step (that return valid XML), property Response and path language XPath
have no idea how to fix it in SoapUI (in pure java it is much more easier)
Ok, my mistake
At the second line I have:
declare namespace ns7="http://schemas.BIGBANK.pl/" xmlns="http://schemas.BIGBANK.pl/"
And if you work with pure XML it is OK attribute set. But in SoapUI it should be:
declare namespace ns7="http://schemas.BIGBANK.pl/"
An now it works fine.

using <#include> resoults in error: Can't find resource

I am implementing a freemarker code in an environment that stores the templates in an database.
for example
${bundle.key}
will display the value of the row with row_id = 'key'
However when I use include directive something doesn't work.
I have a template with a key GenF as follows
<#function PriceFormat Number>
<#return Number?string['0.0000']>
</#function>
if i run
${GenF.PriceFormat(1.568)}
I get the output
1.5680
as expected.
but when i run
<#include bundle.GenF>
${PriceFormat(1.568)}
I receive an error message:
Can't find resource for bundle ...structures.shared.localization.bl.MultiResourceBundle, key
do I use the include directive wrong, or is something was not defined correctly in the Data model by our programmers?
#include expects the name
(path, "file" name) of a template, not the template content itself. See: https://freemarker.apache.org/docs/ref_directive_include.html
What you seem to want is <#bundle.GenF?interpret />. Though note that the parsed template won't be cached that way, unlike when you invoke a template with #include. For #include to be able to resolve "bundle.GenF" as template name (or rather something like "bundle:/GenF", but it's up to you), you have to use a custom TemplateLoader (see Configuration.setTemplateLoader).
As far as you only need this for defining custom number formats, you may also want to consider using custom number formats (https://freemarker.apache.org/docs/pgui_config_custom_formats.html), like ${1.538?string.#bundle_GenF}.

SWIG php how to call reference arguments

I am trying to use my C++ libraries in PHP with SWIG, everything work fine and I generated my shared object precisely. I also include phppointers.i and std_string.i in my interface file. but when I want to call my C++ methods which have reference or pointer arguments in their input section, the method just would not work properly or I got some errors like :
Fatal error:no matching function
for example one of my methods is declared as below:
int func(string &ptr,bool space=true) const;
but when I call this method in my php code as:
$bf->func('abcd',true);
I got this error:
Fatal error:no matching function
I tried to call this function with other ways like:
$str = 'abcd';
$bf->func(&$str,true);
but this time I got following error:
Fatal error: Call-time pass-by-reference has been removed
I am totally confused, I truly appreciate if someone can help me with this problem.

QTP Run Error:Type does not match

Here is a sniplet of the QTP code :
Call CreateResultFile("E:\2012MX\Result\test_d\")
And the error is:
The test run cannot continue due to unrecoverable error. Type does not
match:'CreateResultFile'
What am I doing wrong?
This is the error you would get if CreateResultFile wasn't defined, are you sure such a function exists?
1) Somewhere CreateResultFile is declared as an variable, array or as an class/object. It cann't be called, but has to be used as an object of that type.
-or-
2) You did not use Option Explicit in your script (An Unforgivable Sin: each time you run a script without option explicit, somewhere on Earth a puppy dies). QTP sees undefined functions automagically as undeclared variables and complains with "Type mismatch" as explained in 1.
It could be you did not associate the library (vbs or qfl file) with the CreateResultFile function as a resource to the action you are working in.

Resources