Getting wrong Response while using xmlNewDocText

I am getting this

<MainTag>
	<event id="1007" ">
		<abc>
			<name>RAM</name>
			<valid>false</valid>
		</abc>
	</event>
</MainTag>

But I want This

<MainTag>
	<event id="1007" ">
		<abc>
			<name>RAM</name>
			<valid>false</valid>
		</abc>
			XYZ
	</event>
</MainTag>

I am using
nodePtr = xmlNewDocNode(document,NULL,X_LIB(Main_Tag),NULL);

… some code to read the values from textField and setAtribute which are working correctly as seen in resonse

xmlNodePtr xyzTypePtr = xmlNewDocText(document,X_LIB(XYZ);
 xmlAddChild(nodePtr,xyzTypePtr);

Please attach your XML tree construction code. It’s hard to root cause an issue with 2 lines of code.

This is the nth time you’ve been requested to attach code by multiple people in this forum.

1 Like

@Sid Thanks for your reply Due to company code restriction I can’t disclose all information , sometimes we misses small issue while writing code that’s why I asked here as Libxml2 documentation I guess is very helpful (Ifykyk) . Somehow I solved it :slightly_smiling_face: hopefully this was the last question .

The general idea is to attach a small and self-contained example that exhibits the issue. It doesn’t need to have any details pertaining to the project / company that you work for.

When creating the example code, you reduce the scope of the issue and in most cases you’ll end up solving the issue by yourself. If not, you can post the example code here.

1 Like

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.