summaryrefslogtreecommitdiff
path: root/transex3
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-01-27 14:58:47 +0000
committerOliver Bolte <obo@openoffice.org>2005-01-27 14:58:47 +0000
commit65aaccd41c47dc46ae1258f3ca85c281bc6a2036 (patch)
tree5e3d4d8dad26d030f9f417c9737fbfb6b01e88bf /transex3
parente6fd38ee478c0d87eae43e97b3c79b321eb842a6 (diff)
INTEGRATION: CWS babelfish05 (1.5.6); FILE MERGED
2005/01/24 17:42:38 ihi 1.5.6.2: RESYNC: (1.5-1.7); FILE MERGED 2005/01/18 16:22:02 ihi 1.5.6.1: #i40909# Remove redudant xml-lang attributes from helpcontent2 strings
Diffstat (limited to 'transex3')
-rw-r--r--transex3/source/xmlparse.cxx49
1 files changed, 32 insertions, 17 deletions
diff --git a/transex3/source/xmlparse.cxx b/transex3/source/xmlparse.cxx
index 2b73b2c06387..6f1e009f373c 100644
--- a/transex3/source/xmlparse.cxx
+++ b/transex3/source/xmlparse.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlparse.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: kz $ $Date: 2005-01-18 15:12:15 $
+ * last change: $Author: obo $ $Date: 2005-01-27 15:58:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -462,12 +462,19 @@ void XMLFile::Print( XMLNode *pCur, USHORT nLevel )
fprintf( stdout, "<%s", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer());
if ( pElement->GetAttributeList())
- for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ )
- fprintf( stdout, " %s=\"%s\"",
- ByteString( *pElement->GetAttributeList()->GetObject( j ),
- RTL_TEXTENCODING_UTF8 ).GetBuffer(),
- ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),
- RTL_TEXTENCODING_UTF8 ).GetBuffer());
+ for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){
+ ByteString aAttrName( *pElement->GetAttributeList()->GetObject( j ), RTL_TEXTENCODING_UTF8 );
+ //if( !( bNo_XML_Lang && aAttrName.EqualsIgnoreCaseAscii( XML_LANG ) ) ){
+ //if( !aAttrName.EqualsIgnoreCaseAscii( XML_LANG ) ){
+ if( !aAttrName.EqualsIgnoreCaseAscii( XML_LANG ) ) {
+ fprintf( stdout, " %s=\"%s\"",
+ //ByteString( *pElement->GetAttributeList()->GetObject( j ),
+ // RTL_TEXTENCODING_UTF8 ).GetBuffer(),
+ aAttrName.GetBuffer(),
+ ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),
+ RTL_TEXTENCODING_UTF8 ).GetBuffer());
+ }
+ }
if ( !pElement->GetChildList())
fprintf( stdout, "/>" );
else {
@@ -879,10 +886,12 @@ OUString XMLElement::ToOUString(){
return result;
}
/*****************************************************************************/
-void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement){
+void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement ){
/*****************************************************************************/
const String COMMENT = String::CreateFromAscii("comment");
XMLUtil& xmlutil=XMLUtil::Instance();
+ const OUString XML_LANG ( OUString::createFromAscii("xml-lang") );
+
if(pCur!=NULL){
if(rootelement){
XMLElement *pElement = ( XMLElement * ) pCur;
@@ -901,18 +910,25 @@ void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement)
switch( pCur->GetNodeType()) {
case XML_NODE_TYPE_ELEMENT: {
XMLElement *pElement = ( XMLElement * ) pCur;
+
if( !pElement->GetName().EqualsIgnoreCaseAscii( COMMENT ) ){
buffer.append( OUString::createFromAscii("\\<") );
buffer.append( pElement->GetName() );
- if ( pElement->GetAttributeList())
+ if ( pElement->GetAttributeList()){
for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){
- buffer.append( OUString::createFromAscii(" ") );
- buffer.append( *pElement->GetAttributeList()->GetObject( j ) );
- buffer.append( OUString::createFromAscii("=") );
- buffer.append( OUString::createFromAscii("\\\"") );
- buffer.append( pElement->GetAttributeList()->GetObject( j )->GetValue() );
- buffer.append( OUString::createFromAscii("\\\"") );
+
+ OUString aAttrName( *pElement->GetAttributeList()->GetObject( j ) );
+ if( !aAttrName.equalsIgnoreAsciiCase( XML_LANG ) ) {
+ //buffer.append( *pElement->GetAttributeList()->GetObject( j ) );
+ buffer.append( OUString::createFromAscii(" ") );
+ buffer.append( aAttrName );
+ buffer.append( OUString::createFromAscii("=") );
+ buffer.append( OUString::createFromAscii("\\\"") );
+ buffer.append( pElement->GetAttributeList()->GetObject( j )->GetValue() );
+ buffer.append( OUString::createFromAscii("\\\"") );
+ }
}
+ }
if ( !pElement->GetChildList())
buffer.append( OUString::createFromAscii("/\\>") );
else {
@@ -927,7 +943,6 @@ void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement)
buffer.append( OUString::createFromAscii("\\>") );
}
}
-
}
break;
case XML_NODE_TYPE_DATA: {