|
|
Hi everyone,
I'm developing C# application that uses XML as its file format, and XSLT as its rendering engine. It is basically a specialized application of the XML/XSLT document model. The document can be displayed directly in a browser, and is edited in a WebBrowser control.
Now, my question is: how should I go about designing the document model?
DOCUMENT
should it be 1) a sub-class inherited from XmlDocument, with extended capabilities, or 2) a class containing an XmlDocument object. I tend to think the former, but what do you guys think?
NODES
There are different kinds of nodes representing various different types of objects in the document. It would be nice to be able to edit them without directly using the XmlNode "interface" - in other words, through a wrapper. However, since the document is being directly edited in a browser control, the document must be able to be rendered as XML at any time - therefore it must be closely tied to the XML object model. How would you go about this? Would it be workable to create a sub-class for each type of object in the document, inheriting from XmlNode?
Any educated advice would be appreciated.
Thanks in advance,
Justin Dunlap
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
always tell me "illagal symbol" how can i do?
|
|
|
|
|
check your encoding PI in your XML.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
does anyone know how to change an image size in xsl?
also upload an image to a datagrid?
if anyone can help me with either it will be greatly appreciated.
Da Intern
|
|
|
|
|
changing the image size directly from the xml file
Da Intern
|
|
|
|
|
your not being very clear, what are yu transforming the xml into?
assuming you mean html, then just specify the size attribute on the img element.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Dear everyone,
We know that use FOP(Based JAVA) could convert XSL-FO to PDF,
but now we need develop the process(XSL-FO to PDF) with VC.
Could you tell me more information and resource about this?
Could you tell me where could find the free or payment dll or
ocx which could finish the function?
Could you tell me using which method or technology is better?
Welcome any questions! Many thks to u.
Bosicat
Good Luck
|
|
|
|
|
|
Is there anyway to load an image using xsl from an xml table?
Da Intern
|
|
|
|
|
I'm looking at getting a different tool to help me process the xml comments in our C# code. I was using NDoc (cool, but doesn't seem to support .NET 2003), then tried Tee Gopher (works, but very, very weak content editor).
Does anyone have recommendations for another tool?
Thanks in advance.
Sincerely,
Mark
|
|
|
|
|
I thought that XML documentation for C# was intrinsically supported in .NET, but not for VB.NET.
I use it all the time in SharpDevelop.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Well, the extraction of the comments to an XML file is supported. But the processing of that file into documentation (an online help file) isn't. That's the type of tool I'm looking for. For example, NDoc will take the comments and the assemblies and generate a help file document that's all hyperlinked together just like the MSDN documentation is for all the classes and interfaces in the assemblies. The remarks, etc are filled in by the comments in the code.
Mark
|
|
|
|
|
Here's the info I was looking for:
http://www.sys-con.com/dotnet/readerschoice2003/liveupdate.cfm?BType=30
The link above has number of these tools.
(I post this here in case these threads get archived so if someone searches for the same topic they'll find the answer).
|
|
|
|
|
Okay, i have a problem...............i need to convert xml data into html data because i need it to be viewable in outlook and outlook only supports html. Thanks !!!
Any help would be greatly appreciated!!
Da Intern
|
|
|
|
|
XSL Tester[^]. That's what I use.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
|
I wrote a function that gets a attribute value that is in hex. Am I reinventing the wheel? The problem is that I can't get it to work.
Here was my first attempt which failed because it didn't convert to hex (even though the the type is xsd:hexBinary):
HRESULT hr;
CComVariant value;
hr = pElement->getAttribute( CComBSTR( sName ), &value );
hr = value.ChangeType( VT_UINT );
Here is my second attempt which works for values using digits '0'-'9' but fails for values using digits 'a'-'f' (and 'A'-'F') (VarParseNumFromStr returns DISP_E_TYPEMISMATCH):
HRESULT hr;
CComVariant value;
NUMPARSE np = { 10, NUMPRS_HEX_OCT|NUMPRS_USE_ALL, 0, 0, 4 };
unsigned char digits[10];
CComVariant vHex;
hr = pElement->getAttribute( CComBSTR( sName ), &value );
hr = VarParseNumFromStr( value.bstrVal, GetUserDefaultLCID(),
NUMPRS_HEX_OCT|NUMPRS_USE_ALL,
&np, digits );
np.nBaseShift = 4;
hr = VarNumFromParseNum( &np, digits, VTBIT_UI4, &vHex );
hr = vHex.ChangeType( VT_UINT );
Anyone know what is wrong or what the right way to do this is?
|
|
|
|
|
How to insert data from XML file into SQL server database using javascript/vbscript or using ASP.
|
|
|
|
|
Hi,
I've got a strange problem. I have a multithreading Win32 MFC application used MSXML. All XML-related procedures (loading, parsing and etc) are worked in a separated thread started with _begingthread().
This thread looks like as shown below. When this thread calls IXMLDOMDocument::load() to load an existed XML document from a file, this will stop an opening all Microsoft Office 2000 documents (Word,Excel and etc).
This problem appears only under Windows 9x/ME.
What's wrong? Help me!
void XMLTrafReportThreadFunction(void *)
{
::CoInitializeEx(NULL,COINIT_MULTITHREADED);
IXMLDOMDocumentPtr XmlDocPtr;
_bstr_t bstrXMLReport(lpszFilename);
VARIANT_BOOL vtResult;
HRESULT hr = XmlDocPtr.CreateInstance(MSXML::CLSID_DOMDocument);
if (FAILED(hr)) return 0;
vtResult=XmlDocPtr->load(bstrXMLReport);
...
...
}
Yours sincerely,
Alex Bash
|
|
|
|
|
Hi,
I have created a simple MFC/C++ Program that uses MS XML 3.0 and Below is the code as well as XML file. Its a very smal XML file and I need to parse it and get info like
ID = "DEV01"
Name = "robotest" etc But, I am just getting tag names and I am not getting Values
Can anyone point out where I am going wrong ??? XMLPad.exe parses it properly !! Help..
XML file is:
<DEVID ID = "DEV01" NAME = "robotest">
<CAPABILITY VALUE = "0x051" />
<CHAN NUMBER = "10" />
<CHAN STRENGTH = "2" />
</DEVID>
////////////// MFC Code (COM)////////////////
#import <msxml.dll> named_guids
using namespace MSXML;
IXMLDOMDocumentPtr m_plDomDocument; //pointer to the xml document
IXMLDOMElementPtr m_pDocRoot; //pointer to the root
::AfxOleInit();
::CoInitialize(NULL);
HRESULT hr = m_plDomDocument.CreateInstance(MSXML::CLSID_DOMDocument);
if(FAILED(hr))
{
AfxMessageBox("Error!!");
}
...
...
CFileDialog fd(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_FILEMUSTEXI
ST,"XML Files (*.xml)|*.xml||", this);
fd.m_ofn.lpstrTitle = "Choose XML File";
if(fd.DoModal()==IDOK)
{
CString file = fd.GetPathName();
_bstr_t filename = file.AllocSysString();
variant_t vResult;
vResult = m_plDomDocument->load(filename);
if((bool)vResult==TRUE)
{
m_pDocRoot = m_plDomDocument->documentElement;
AfxMessageBox("Document Loaded !!");
AfxMessageBox(m_pDocRoot->xml);
HTREEITEM hxmlRoot = TVI_ROOT;
BuildTree(m_pDocRoot, &m_tree, hxmlRoot);
}
else
{
AfxMessageBox("Document Failed!!");
}
}
.....
void CXMLDialog::BuildTree(IXMLDOMNodePtr pParent, CTreeCtrl *m_pTree, HTREEITEM hParent)
{
HTREEITEM hChild;
InsertNode(pParent, m_pTree, hParent, hChild);
for(IXMLDOMNodePtr pChild = pParent->firstChild; NULL != pChild; pChild = pChild->nextSibling)
{
BuildTree(pChild,m_pTree,hChild);
}
}
...
void CXMLDialog::InsertNode(IXMLDOMNodePtr pParent, CTreeCtrl *m_pTree, HTREEITEM hParent, HTREEITEM &hChild)
{
if(pParent->nodeType == MSXML::NODE_TEXT)
{
m_pTree->InsertItem(pParent->text, hParent, TVI_LAST);
}
else
{
hChild = m_pTree->InsertItem(pParent->nodeName, hParent, TVI_LAST);
}
}
|
|
|
|
|
Attributes aren't part of the child tree as you are trying to use it. Attributes are considered separate by the DOM and need to be accessed via IXMLDOMElement::getAttribute or IXMLDOMNode::attributes, with the later being best for you usage as you can iterate over all available attributes.
|
|
|
|
|
Hello,
I have created XSD file using Visual Studio .NET and
was trying to load it using your "XML Data Editor".
It does not react at all. The XSD file is very simple.
What I did : I took yours sale5.xml into VS.NET and created
schema. Then was trying to load it into your Data Editor.
Please advise.
Thank you in advance.
Oleg.
|
|
|
|
|
Hi everyone,
I'm new to XML and my question is how does one use the Expat library to look for let’s say all of the authors in a XML file.
Any help would be greatly appreciated.
Ken
|
|
|
|
|
Expat uses a callback mechanism to parse documents (similar to SAX). So, basically you make a callback function for elements that checks if the element is an "author" (and does something with that data), you register that handler, then you start the parser.
There is a good tutorial on getting started with Expat here:
"Using Expat" by Clark Cooper.
- Mike
|
|
|
|